Rafael Soufraz asked:
I can not make any operation in mysql:
root@server2 [/]# /etc/init.d/mysql status MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED] root@server2 [/]# /etc/init.d/mysql start Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/server2.myaddress.com.br.pid). root@server2 [/]# /etc/init.d/mysql stop MySQL server PID file could not be found! [FAILED] root@server2 [/]# /etc/init.d/mysql restart MySQL server PID file could not be found! [FAILED] Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/server2.myaddress.com.br.pid). root@server2 [/]# mysql -u root ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
My file /etc/my.cnf:
root@server2 [~]# cat /etc/my.cnf [mysqld] user = mysql skip-external-locking key_buffer = 384M max_allowed_packet=268435456 max_connections = 500 max_user_connections = 35 wait_timeout=40 connect_timeout=10 table_cache = 512 sort_buffer_size = 2M read_buffer_size = 2M read_rnd_buffer_size = 8M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size = 32M thread_concurrency = 8 server-id = 1 skip-innodb [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash [myisamchk] key_buffer = 256M sort_buffer_size = 256M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout
Searching in some posts, I found that some program may be holding mysql. Follow the command checked:
root@server2 [~]# lsof | grep mysql tailwatch 20718 root mem REG 3,5 206553 8922204 /usr/local/cpanel/3rdparty/perl/514/lib/perl5/cpanel_lib/i386-linux-64int/auto/DBD/mysql/mysql.so
yum info mysql-server
root@server2 [~]# yum info mysql-server Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.aol.com * extras: centos.chi.host-engine.com * updates: mirror.lug.udel.edu Excluding Packages in global exclude list Finished Error: No matching Packages to list
Other information ..
- There is no process running mysql.
- CentOS release 5.10 (Final)
- I already deleted files with extension .err and tried again. But it did not work.
- When I try to start mysql in safe mode, apparently there is no error. But still does not work and any subsequent operation does not work.
- I’ve tried also move ib_logfile logs to mysql create new files. Unsuccessful attempt.
Log in /var/lib/mysql/server2.myaddress.com.br.err
140829 14:23:58 [Note] Plugin 'FEDERATED' is disabled. 140829 14:23:58 [Note] Plugin 'InnoDB' is disabled. /usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 140829 14:23:58 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 140829 14:23:58 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 140829 14:23:58 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 140829 14:23:58 [Note] Server socket created on IP: '0.0.0.0'. 140829 14:23:58 [ERROR] /usr/sbin/mysqld: Can't find file: './mysql/proxies_priv.frm' (errno: 13) 140829 14:23:58 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/proxies_priv.frm' (errno: 13) 140829 14:23:58 mysqld_safe mysqld from pid file /var/lib/mysql/server2.myaddress.com.br.pid ended
errno: 13 is permission denied, which means the database files exist, but MySQL doesn’t have permission to access them. To resolve the problem, fix the permissions and SELinux contexts.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.