mysql not starting...HELP!!! [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

mysql not starting...HELP!!! [Solved]

Postby gocool » Wed Oct 02, 2013 12:28

Hi Freinds,
I am getting the following error trying to open mysql

Code: Select all
[email protected] ~ $ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


I assume that now with systemctl the service name is mysql.service or mysqld.service and tried to check, but no luck

Code: Select all
[email protected] ~ $ systemctl status mysql.service
mysql.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)
[email protected] ~ $ systemctl status mysqld.service
mysqld.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)



Code: Select all
sabayon init.d # ps -ef | grep mysql
user      5904  5902  0 Oct01 ?        00:02:04 /usr/sbin/mysqld --defaults-file=/home/user/.local/share/akonadi/mysql.conf --datadir=/home/user/.local/share/akonadi/db_data/ --socket=/home/user/.local/share/akonadi/socket-sabayon/mysql.socket
root      7136  4173  0 07:17 pts/1    00:00:00 grep --colour=auto mysql


I find both the logfiles empty /var/log/mysql/mysql.err and /var/log/mysql/mysql.log

I am not sure if we can use the service command, but tried it and got the below output.
Code: Select all
sabayon etc # service mysql start
 * WARNING: mysql is already starting

So I think the service is not starting...so how would I go about starting it?
Last edited by gocool on Thu Oct 03, 2013 21:15, edited 1 time in total.
gocool
Growing Hen
 
Posts: 139
Joined: Wed Aug 06, 2008 13:37

Re: mysql not starting...HELP!!!

Postby Cb7 » Thu Oct 03, 2013 14:21

Code: Select all
cp "/usr/lib64/systemd/system/mysqld@.service" /etc/systemd/system/mysqld.service
After that using service with systemctl should work.
Why, and how to add "[Solved]" to your post. Please read. ← credits to Fitzcarraldo

Kind regards
~Zetok Zalbavar
Cb7
Growing Hen
 
Posts: 104
Joined: Sun Apr 07, 2013 7:13

Re: mysql not starting...HELP!!!

Postby gocool » Thu Oct 03, 2013 20:55

Thank you cb7. But is it needed to be copied or even creating a softlink would do?

I created a soft link to it as you can see below
Code: Select all
sabayon system # ls -l
total 28
...
...
lrwxrwxrwx 1 root root   39 Oct  3 14:42 mysqld.service -> /usr/lib/systemd/system/mysqld@.service
...
...
lrwxrwxrwx 1 root root   43 Apr 25 11:52 syslog.service -> ///usr/lib/systemd/system/syslog-ng.service


but when I try to start the service this is the error I get

Code: Select all
sabayon user # systemctl start mysqld.service
Failed to issue method call: Unit mysqld.service failed to load: Invalid argument. See system logs and 'systemctl status mysqld.service' for details.


So I went ahead and gave the systemctl status mysqld.service to see what it says and it came up with this :

Code: Select all
sabayon user # systemctl status mysqld.service
mysqld.service
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

Oct 03 14:38:46 sabayon mysqld-prepare-db-dir[14979]: OK
Oct 03 14:38:46 sabayon mysqld-prepare-db-dir[14979]: To start mysqld at boot time you have to copy
Oct 03 14:38:46 sabayon mysqld-prepare-db-dir[14979]: support-files/mysql.server to the right place for your system
Oct 03 14:38:46 sabayon mysqld-prepare-db-dir[14979]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
Oct 03 14:38:46 sabayon mysqld-prepare-db-dir[14979]: To do so, start the server, then issue the following commands:
Oct 03 14:38:47 sabayon mysqld_safe[15084]: 131003 14:38:47 mysqld_safe Logging to '/var/log/mysql/mysqld.err'.
Oct 03 14:38:47 sabayon mysqld_safe[15084]: 131003 14:38:47 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Oct 03 14:38:51 sabayon systemd[1]: Started MySQL database server.
Oct 03 14:56:17 sabayon systemd[1]: Stopping MySQL database server...
Oct 03 14:56:22 sabayon systemd[1]: Stopped MySQL database server.
gocool
Growing Hen
 
Posts: 139
Joined: Wed Aug 06, 2008 13:37

Re: mysql not starting...HELP!!!

Postby gocool » Thu Oct 03, 2013 21:14

Thank you cb7.

I guess you should not create a softlink but just copy the entire mysql@.service to /etc/systemd/system folder.

This seems to work.


Thanks again friend.
gocool
Growing Hen
 
Posts: 139
Joined: Wed Aug 06, 2008 13:37


Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 2 guests

cron