[ERROR] Can not start MySQL/MariaDB on CentOS 7 x64

quangtam

Verified User
Joined
Sep 8, 2011
Messages
19
I've tried many time to solve this issue but I can't. I've spend more than 5 hours to find out the solution, but not.

When I install DirectAdmin with default or custom build, on step install database, I've got error:

Code:
usermod: no changes
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.
● mysqld.service - MySQL database server
   Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Wed 2016-01-27 00:26:38 ICT; 7ms ago
  Process: 6083 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
 Main PID: 6083 (code=exited, status=0/SUCCESS)

Jan 27 00:21:37 server11.***.com systemd[1]: Starting MySQL database server...
Jan 27 00:21:37 server11.***.com mysqld_safe[6083]: 160127 00:21:37 mysqld_safe Logging to '/var/lib/mysql/server11.***.com.err'.
Jan 27 00:21:37 server11.***.com mysqld_safe[6083]: 160127 00:21:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jan 27 00:26:37 server11.***.com systemd[1]: mysqld.service start-post operation timed out. Stopping.
Jan 27 00:26:38 server11.***.com mysqld_safe[6083]: 160127 00:26:38 mysqld_safe mysqld from pid file /var/lib/mysql/server11.***... ended
Jan 27 00:26:38 server11.***.com systemd[1]: Failed to start MySQL database server.
Jan 27 00:26:38 server11.***.com systemd[1]: Unit mysqld.service entered failed state.
Jan 27 00:26:38 server11.***.com systemd[1]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
Waiting for mysqld to start....
Setting MySQL Root Password...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Setting DirectAdmin user and password...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Updating privilege tables...
Linking 64 bit mysql libraries: /usr/lib64/libmysqlclient -> /usr/lib/mysql/* ...
and this:
Code:
Stopping mysqld ...
Updating MariaDB 5.5.41 to 5.5.47
Preparing...                          ################################# [100%]
Updating / installing...
   1:MariaDB-compat-5.5.47-1.el6      ################################# [  8%]
   2:MariaDB-common-5.5.47-1.el6      ################################# [ 17%]
   3:MariaDB-client-5.5.47-1.el6      ################################# [ 25%]
   4:MariaDB-server-5.5.47-1.el6      ################################# [ 33%]
   5:MariaDB-devel-5.5.47-1.el6       ################################# [ 42%]
   6:MariaDB-shared-5.5.47-1.el6      ################################# [ 50%]
Cleaning up / removing...
   7:MariaDB-devel-5.5.41-1.el7.centos################################# [ 58%]
   8:MariaDB-server-5.5.41-1.el7.cento################################# [ 67%]
   9:MariaDB-client-5.5.41-1.el7.cento################################# [ 75%]
  10:MariaDB-compat-5.5.41-1.el7.cento################################# [ 83%]
  11:MariaDB-shared-5.5.41-1.el7.cento################################# [ 92%]
  12:MariaDB-common-5.5.41-1.el7.cento################################# [100%]
Job for mysqld.service failed because a timeout was exceeded. See "systemctl status mysqld.service" and "journalctl -xe" for details.
Giving mysqld a few seconds to start up...
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
FATAL ERROR: Upgrade failed
/usr/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
cp: '/usr/lib/libmysqlclient.so' and '/usr/lib/mysql/libmysqlclient.so' are the same file
Restarting MySQL.
Please help me :(
 
Last edited:

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,904
Location
LT, EU
When did you try it last time? Please try:
Code:
wget -O [COLOR=#000000]/usr/libexec/mysql-wait-ready [/COLOR]http://files1.directadmin.com/services/custombuild/2.0/custombuild/configure/systemd/scripts/mysql-wait-ready
 

quangtam

Verified User
Joined
Sep 8, 2011
Messages
19
When did you try it last time? Please try:
Code:
wget -O [COLOR=#000000]/usr/libexec/mysql-wait-ready [/COLOR]http://files1.directadmin.com/services/custombuild/2.0/custombuild/configure/systemd/scripts/mysql-wait-ready
Hi smtalk,

I've get the script but what I need to do next step?

Thanks,
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,904
Location
LT, EU
Just:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build mysql
And check if that solved the problem :)
 

quangtam

Verified User
Joined
Sep 8, 2011
Messages
19
Just:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build mysql
And check if that solved the problem :)

I'm sorry, I've tried with your solution but issue still there :( MySQL always start in mysql_safe
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,904
Location
LT, EU
May you open a new ticket for that in tickets.directadmin.com?
 

transix

Verified User
Joined
May 10, 2006
Messages
36
Location
The Netherlands
I seem to have the same problem during installation.

Centos 7.2 64bits and custombuild 2
Tried Mariadb 5.5 and 10.0 so far nothing.
 

transix

Verified User
Joined
May 10, 2006
Messages
36
Location
The Netherlands
Ok i think i fixed it.

Few problems are that the da_admin did not get created so make sure that you create that one in the end.

But first you need to change the options.conf
mariadb=10.1

Default is 5.5 did not work
Then i tried 10.0 did not work

I did 10.1 and that starts normally except that it doesn`t recognize your standard root setup.txt password. But it starts.
You just need to reset it and make the da-admin user.

Just use
http://help.directadmin.com/item.php?id=45

quick tip:
mysqld_safe --skip-grant-tables &
you still have to use
mysql -u root
to get into the prompt of the database without the password.

Hope it helps, and directadmin looks into it.
Centos 7.2 + custombuild 2 + mariadb

good luck.
 

robchael

New member
Joined
Feb 1, 2016
Messages
1
Ok i think i fixed it.

Few problems are that the da_admin did not get created so make sure that you create that one in the end.

But first you need to change the options.conf
mariadb=10.1

Default is 5.5 did not work
Then i tried 10.0 did not work

I did 10.1 and that starts normally except that it doesn`t recognize your standard root setup.txt password. But it starts.
You just need to reset it and make the da-admin user.

Just use
http://help.directadmin.com/item.php?id=45

quick tip:
mysqld_safe --skip-grant-tables &
you still have to use
mysql -u root
to get into the prompt of the database without the password.

Hope it helps, and directadmin looks into it.
Centos 7.2 + custombuild 2 + mariadb

good luck.
I have same issue, and I can fix it with the same way. Thanks transix.
 

quangtam

Verified User
Joined
Sep 8, 2011
Messages
19
Thanks for your help, I've re-install OS with CentOS 6.7 and everything ok.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
4,531
Location
Maastricht
Didn't you read? It is already solved.
Seems to me you are answering questions unneccesary to advertise for your forum.
 
Top