Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

Could not connect to mysql server

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Post Reply
  • Print view
Advanced search
8 posts • Page 1 of 1
Bif
Posts: 1
Joined: Wed May 13, 2015 5:19 am

Could not connect to mysql server
  • Quote

Post by Bif » Wed May 13, 2015 5:22 am

How to connect this error. Could not connect to MySQL server
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Could not connect to mysql server
  • Quote

Post by skurudo » Wed May 13, 2015 5:45 am

Your mysql service work?
What - service mysql status - say? (in centos mysqld)
if mysql stopped, try to start again.
Top

prajya
Posts: 5
Joined: Fri May 01, 2015 10:38 am

Re: Could not connect to mysql server
  • Quote

Post by prajya » Wed May 13, 2015 10:37 am

Could not connect to mysql server
Me too, restart server can temporary solve this problem, but when past 1 week i will meet this problem again, can you help me ?

My server is Ubuntu 14.04.1 RAM 512 MB, 1 Core CPU,

Thank you very much

This is my MSQL Logs

150512 20:46:43 [Note] Plugin 'FEDERATED' is disabled.
150512 20:46:43 InnoDB: The InnoDB memory heap is disabled
150512 20:46:43 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150512 20:46:43 InnoDB: Compressed tables use zlib 1.2.8
150512 20:46:43 InnoDB: Using Linux native AIO
150512 20:46:43 InnoDB: Initializing buffer pool, size = 128.0M
150512 20:46:43 InnoDB: Completed initialization of buffer pool
150512 20:46:43 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
150512 20:46:43 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
150512 20:46:43 InnoDB: Waiting for the background threads to start
150512 20:46:44 InnoDB: 5.5.43 started; log sequence number 22991236
150512 20:46:44 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
150512 20:46:44 [Note] - '0.0.0.0' resolves to '0.0.0.0';
150512 20:46:44 [Note] Server socket created on IP: '0.0.0.0'.
150512 20:46:44 [Note] Event Scheduler: Loaded 0 events
150512 20:46:44 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.43-0ubuntu0.14.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
150512 22:15:18 [Note] Plugin 'FEDERATED' is disabled.
150512 22:15:18 InnoDB: The InnoDB memory heap is disabled
150512 22:15:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150512 22:15:18 InnoDB: Compressed tables use zlib 1.2.8
150512 22:15:18 InnoDB: Using Linux native AIO
150512 22:15:18 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
150512 22:15:18 InnoDB: Completed initialization of buffer pool
150512 22:15:18 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150512 22:15:18 [ERROR] Plugin 'InnoDB' init function returned error.
150512 22:15:18 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150512 22:15:18 [ERROR] Unknown/unsupported storage engine: InnoDB
150512 22:15:18 [ERROR] Aborting

150512 22:15:18 [Note] /usr/sbin/mysqld: Shutdown complete
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Could not connect to mysql server
  • Quote

Post by skurudo » Wed May 13, 2015 11:02 am

What's your server configuration? Memory, cpu?
Show please your mysql config.
Top

prajya
Posts: 5
Joined: Fri May 01, 2015 10:38 am

Re: Could not connect to mysql server
  • Quote

Post by prajya » Wed May 13, 2015 11:52 am

/usr/local/vesta/conf/mysql.conf
HOST='localhost' USER='root' PASSWORD='password' CHARSETS='UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8' MAX_DB='500' U_SYS_USERS='' U_DB_BASES='6' SUSPENDED='no' TIME='05:49:16' DATE='2015-05-02'

/etc/mysql/my.cnf
[client]
port=3306
socket=/var/run/mysqld/mysqld.sock

[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock

[mysqld]
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
tmpdir=/tmp
lc-messages-dir=/usr/share/mysql
log_error=/var/log/mysql/error.log
max_connections=200
max_user_connections=30
wait_timeout=30
interactive_timeout=50
long_query_time=5
innodb_file_per_table

!includedir /etc/mysql/conf.d/


/root/.my.cnf
not see this file

You want another files, information ?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Could not connect to mysql server
  • Quote

Post by skurudo » Wed May 13, 2015 12:22 pm

Nope, it's fine. On your server mysql eat too much memory, you don't have so much ;-)
You need tune your config and use smaller settings. Like this config:

Code: Select all

# From mysql 5.5 low memory use 231M
#####
 
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
max_connections=70
max_user_connections=30
wait_timeout=10
interactive_timeout=50
slow_query_log = 0
long_query_time= 5
log-queries-not-using-indexes
slow_query_log_file=/var/log/mysql/log-slow-queries.log
 
key_buffer_size = 8M
myisam_sort_buffer_size = 4M
join_buffer_size = 512K
read_buffer_size = 512K
sort_buffer_size = 1M
table_cache = 2048
thread_cache_size = 128
max_allowed_packet = 16M
query_cache_limit = 2M
query_cache_size = 8M
tmp_table_size = 16M
 
#innodb_use_native_aio = 0
innodb_file_per_table
innodb_buffer_pool_size = 8M
 
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Top

prajya
Posts: 5
Joined: Fri May 01, 2015 10:38 am

Re: Could not connect to mysql server
  • Quote

Post by prajya » Fri May 15, 2015 1:40 am

I replace this code in my /etc/mysql/my.cnf, i can see more free memory,but i can not connect to mysql server, what something wrong ? i need to do anything more ? my host have 3 websites.

Thank you very much.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Could not connect to mysql server
  • Quote

Post by skurudo » Mon Jun 01, 2015 1:04 pm

What error you get? In site error log or mysql log?
Top


Post Reply
  • Print view

8 posts • Page 1 of 1

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password