 |
 |
 |
 |
| Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc. |

23rd August 2012, 04:52 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Can't start MySQL
Hi,
I have install MySQL serve in Fedora 16 32 bi distro that I have on my pc, but I can't start MySQL from command line. Can you please help? Thanks.
---------- Post added at 08:52 AM ---------- Previous post was at 07:10 AM ----------
Code:
[root@localhost john]# rpm -qa mysql
mysql-5.5.25a-1.fc16.i686
[root@localhost john]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost john]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost john]# mysql -h localhost -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost john]# hostname
localhost.localdomain
[root@localhost john]# mysql -h localhost.localdomain -u root -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost.localdomain' (111)
[root@localhost john]#
Last edited by tech291083; 23rd August 2012 at 04:58 PM.
|

23rd August 2012, 05:53 PM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: Como - Italy
Posts: 248

|
|
|
Re: Can't start MySQL
You have to run
Code:
mysql_secure_installation
to set up your mysql server.
EDIT: by the way: have you started mysqld service?
Code:
service mysqld start
Last edited by marvin_ita; 23rd August 2012 at 05:55 PM.
|

23rd August 2012, 06:16 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Re: Can't start MySQL
Code:
[john@localhost ~]$ su
Password:
[root@localhost john]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
I entered the root password for my fedora, but it is still not working, thanks.
---------- Post added at 10:16 AM ---------- Previous post was at 09:59 AM ----------
Code:
[john@localhost ~]$ su
Password:
[root@localhost john]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Job failed. See system logs and 'systemctl status' for details.
[root@localhost john]# /bin/systemctl start mysqld.service
Job failed. See system logs and 'systemctl status' for details.
|

24th August 2012, 02:02 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Re: Can't start MySQL
Code:
[root@localhost john]# systemctl start mysqld.service
Job failed. See system logs and 'systemctl status' for details.
[root@localhost john]# systemctl status mysqld.service
mysqld.service - MySQL database server
Loaded: loaded (/lib/systemd/system/mysqld.service; disabled)
Active: failed since Fri, 24 Aug 2012 18:25:29 +0530; 29s ago
Process: 2104 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir (code=exited, status=254)
CGroup: name=systemd:/system/mysqld.service
[root@localhost john]#
---------- Post added at 05:59 AM ---------- Previous post was at 05:57 AM ----------
I can't really understand as to what is wrong with the MySQL installation on my pc.
---------- Post added at 06:02 AM ---------- Previous post was at 05:59 AM ----------
This may be stupid, but it is exactly what I tried......
Code:
[root@localhost john]# yum install systemctl
Loaded plugins: langpacks, presto, refresh-packagekit
adobe-linux-i386 | 951 B 00:00
updates/metalink | 5.1 kB 00:00
updates | 4.7 kB 00:00
updates/primary_db | 5.5 MB 01:30
No package systemctl available.
Error: Nothing to do
|

24th August 2012, 03:07 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105

|
|
|
Re: Can't start MySQL
Try "systemctl enable mysqld.service", then try "systemctl start mysqld.service".
I believe it needs to be enabled before it can be started.
|

24th August 2012, 03:22 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Re: Can't start MySQL
Ok, I did what you said, but to n oavail. How do I log into MySQL if it starts working? Here is the official documentation on that.
http://dev.mysql.com/doc/refman/5.6/...onnecting.html
Which of the following should I try?
mysql -h host -u user -p
mysql -u user -p
mysql
Code:
[john@localhost ~]$ su
Password:
[root@localhost john]# systemctl enable mysqld.service
[root@localhost john]# systemctl status mysqld.service
mysqld.service - MySQL database server
Loaded: loaded (/lib/systemd/system/mysqld.service; enabled)
Active: failed since Fri, 24 Aug 2012 19:46:15 +0530; 1min 25s ago
CGroup: name=systemd:/system/mysqld.service
[root@localhost john]# systemctl start mysqld.service
Job failed. See system logs and 'systemctl status' for details.
[root@localhost john]# systemctl status mysqld.service
mysqld.service - MySQL database server
Loaded: loaded (/lib/systemd/system/mysqld.service; enabled)
Active: failed since Fri, 24 Aug 2012 19:47:46 +0530; 5s ago
Process: 2499 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir (code=exited, status=254)
CGroup: name=systemd:/system/mysqld.service
Thanks.
Last edited by tech291083; 24th August 2012 at 03:26 PM.
|

24th August 2012, 04:29 PM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: Como - Italy
Posts: 248

|
|
|
Re: Can't start MySQL
If you do a
Code:
yum list installed mysql*
what do you have? You should end with something like
Code:
mysql.x86_64 5.5.27-1.fc17 @updates
mysql-embedded.x86_64 5.5.27-1.fc17 @updates
mysql-libs.x86_64 5.5.27-1.fc17 @updates
mysql-server.x86_64 5.5.27-1.fc17 @updates
|

26th August 2012, 04:07 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Re: Can't start MySQL
Quote:
Originally Posted by marvin_ita
If you do a
Code:
yum list installed mysql*
what do you have? You should end with something like
Code:
mysql.x86_64 5.5.27-1.fc17 @updates
mysql-embedded.x86_64 5.5.27-1.fc17 @updates
mysql-libs.x86_64 5.5.27-1.fc17 @updates
mysql-server.x86_64 5.5.27-1.fc17 @updates
|
This is what I am getting. Thanks.
Code:
[root@localhost ~]# yum list installed mysql
Loaded plugins: langpacks, presto, refresh-packagekit
Installed Packages
mysql.i686 5.5.27-1.fc16 @updates
[root@localhost ~]# yum list installed mysql*
Loaded plugins: langpacks, presto, refresh-packagekit
Installed Packages
mysql.i686 5.5.27-1.fc16 @updates
mysql++.i686 3.1.0-7.fc16 @fedora
mysql++-devel.i686 3.1.0-7.fc16 @fedora
mysql++-manuals.i686 3.1.0-7.fc16 @fedora
mysql-bench.i686 5.5.27-1.fc16 @updates
mysql-connector-c++.i686 1.1.1-1.fc16 @updates
mysql-connector-c++-devel.i686 1.1.1-1.fc16 @updates
mysql-connector-java.i686 1:5.1.17-1.fc16.1 @fedora
mysql-connector-odbc.i686 5.1.8-3.fc16 @fedora
mysql-connector-python.noarch 1.0.5-1.fc16 @updates
mysql-connector-python3.noarch 1.0.5-1.fc16 @updates
mysql-devel.i686 5.5.27-1.fc16 @updates
mysql-embedded.i686 5.5.27-1.fc16 @updates
mysql-embedded-devel.i686 5.5.27-1.fc16 @updates
mysql-libs.i686 5.5.27-1.fc16 @updates
mysql-mmm.noarch 2.2.1-3.fc15 @fedora
mysql-mmm-agent.noarch 2.2.1-3.fc15 @fedora
mysql-mmm-monitor.noarch 2.2.1-3.fc15 @fedora
mysql-mmm-tools.noarch 2.2.1-3.fc15 @fedora
mysql-proxy.i686 0.8.1-3.fc15 @fedora
mysql-proxy-devel.i686 0.8.1-3.fc15 @fedora
mysql-server.i686 5.5.27-1.fc16 @updates
mysql-test.i686 5.5.27-1.fc16 @updates
mysql-utilities.noarch 1.0.6-1.fc16 @updates
mysql-workbench.i686 5.2.42-1.fc16 @updates
mysqlreport.noarch 3.5-5.fc15 @fedora
mysqltuner.noarch 1.2.0-1.fc15 @fedora
mysqludf_xql.i686 1.0.0-2.fc15 @fedora
Last edited by tech291083; 26th August 2012 at 04:15 PM.
|

1st September 2012, 03:00 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Re: Can't start MySQL
Please help me guys, I am not getting anywhere. Thanks.
|

2nd September 2012, 05:19 PM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: Como - Italy
Posts: 248

|
|
|
Re: Can't start MySQL
Sorry for the late reply, I was on holiday! :-p
I think you can try to look in /var/log directory and check the mysqld.log. Maybe there's something there that says why the service cannot be started.
|

4th September 2012, 11:31 AM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Re: Can't start MySQL
Here it is, thanks. Please help me out.
I have only posted the last few lines of the log as this forum has a limit on lines. Thanks.
Code:
[root@localhost john]# cat /var/log/mysqld.log
Code:
120831 23:30:03 [Note] Event Scheduler: Purging the queue. 0 events
120831 23:30:03 InnoDB: Starting shutdown...
120831 23:30:04 InnoDB: Shutdown completed; log sequence number 1595675
120831 23:30:04 [Note] /usr/libexec/mysqld: Shutdown complete
120831 23:30:04 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120901 17:57:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120901 17:57:13 [Note] Plugin 'FEDERATED' is disabled.
120901 17:57:13 InnoDB: The InnoDB memory heap is disabled
120901 17:57:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120901 17:57:13 InnoDB: Compressed tables use zlib 1.2.5
120901 17:57:13 InnoDB: Using Linux native AIO
120901 17:57:13 InnoDB: Initializing buffer pool, size = 128.0M
120901 17:57:13 InnoDB: Completed initialization of buffer pool
120901 17:57:13 InnoDB: highest supported file format is Barracuda.
120901 17:57:13 InnoDB: Waiting for the background threads to start
120901 17:57:14 InnoDB: 1.1.8 started; log sequence number 1595675
120901 17:57:14 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120901 17:57:14 [Note] - '0.0.0.0' resolves to '0.0.0.0';
120901 17:57:14 [Note] Server socket created on IP: '0.0.0.0'.
120901 17:57:15 [Note] Event Scheduler: Loaded 0 events
120901 17:57:15 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.27' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
120901 18:02:34 [Note] /usr/libexec/mysqld: Normal shutdown
120901 18:02:34 [Note] Event Scheduler: Purging the queue. 0 events
120901 18:02:34 InnoDB: Starting shutdown...
120901 18:02:35 InnoDB: Shutdown completed; log sequence number 1595675
120901 18:02:35 [Note] /usr/libexec/mysqld: Shutdown complete
120901 18:02:35 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120901 18:03:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120901 18:03:22 [Note] Plugin 'FEDERATED' is disabled.
120901 18:03:22 InnoDB: The InnoDB memory heap is disabled
120901 18:03:22 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120901 18:03:22 InnoDB: Compressed tables use zlib 1.2.5
120901 18:03:22 InnoDB: Using Linux native AIO
120901 18:03:22 InnoDB: Initializing buffer pool, size = 128.0M
120901 18:03:22 InnoDB: Completed initialization of buffer pool
120901 18:03:22 InnoDB: highest supported file format is Barracuda.
120901 18:03:23 InnoDB: Waiting for the background threads to start
120901 18:03:24 InnoDB: 1.1.8 started; log sequence number 1595675
120901 18:03:24 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120901 18:03:24 [Note] - '0.0.0.0' resolves to '0.0.0.0';
120901 18:03:24 [Note] Server socket created on IP: '0.0.0.0'.
120901 18:03:25 [Note] Event Scheduler: Loaded 0 events
120901 18:03:25 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.27' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
120901 19:43:30 [Note] /usr/libexec/mysqld: Normal shutdown
120901 19:43:30 [Note] Event Scheduler: Purging the queue. 0 events
120901 19:43:30 InnoDB: Starting shutdown...
120901 19:43:31 InnoDB: Shutdown completed; log sequence number 1595675
120901 19:43:31 [Note] /usr/libexec/mysqld: Shutdown complete
120901 19:43:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120904 03:21:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120904 3:21:47 [Note] Plugin 'FEDERATED' is disabled.
120904 3:21:47 InnoDB: The InnoDB memory heap is disabled
120904 3:21:47 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120904 3:21:47 InnoDB: Compressed tables use zlib 1.2.5
120904 3:21:47 InnoDB: Using Linux native AIO
120904 3:21:47 InnoDB: Initializing buffer pool, size = 128.0M
120904 3:21:47 InnoDB: Completed initialization of buffer pool
120904 3:21:47 InnoDB: highest supported file format is Barracuda.
120904 3:21:48 InnoDB: Waiting for the background threads to start
120904 3:21:49 InnoDB: 1.1.8 started; log sequence number 1595675
120904 3:21:49 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120904 3:21:49 [Note] - '0.0.0.0' resolves to '0.0.0.0';
120904 3:21:49 [Note] Server socket created on IP: '0.0.0.0'.
120904 3:21:49 [Note] Event Scheduler: Loaded 0 events
120904 3:21:49 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.27' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
120904 4:30:31 [Note] /usr/libexec/mysqld: Normal shutdown
120904 4:30:32 [Note] Event Scheduler: Purging the queue. 0 events
120904 4:30:32 InnoDB: Starting shutdown...
120904 4:30:33 InnoDB: Shutdown completed; log sequence number 1595675
120904 4:30:33 [Note] /usr/libexec/mysqld: Shutdown complete
120904 04:30:34 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
120904 15:55:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120904 15:55:21 [Note] Plugin 'FEDERATED' is disabled.
120904 15:55:21 InnoDB: The InnoDB memory heap is disabled
120904 15:55:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120904 15:55:21 InnoDB: Compressed tables use zlib 1.2.5
120904 15:55:21 InnoDB: Using Linux native AIO
120904 15:55:21 InnoDB: Initializing buffer pool, size = 128.0M
120904 15:55:21 InnoDB: Completed initialization of buffer pool
120904 15:55:21 InnoDB: highest supported file format is Barracuda.
120904 15:55:22 InnoDB: Waiting for the background threads to start
120904 15:55:23 InnoDB: 1.1.8 started; log sequence number 1595675
120904 15:55:23 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120904 15:55:23 [Note] - '0.0.0.0' resolves to '0.0.0.0';
120904 15:55:23 [Note] Server socket created on IP: '0.0.0.0'.
120904 15:55:23 [Note] Event Scheduler: Loaded 0 events
120904 15:55:23 [Note] /usr/libexec/mysqld: ready for connections.
|

4th September 2012, 11:35 AM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 988

|
|
|
Re: Can't start MySQL
Here is the log in full, a very long one as attachment in text file, Thanks.
|

5th September 2012, 08:06 PM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: Como - Italy
Posts: 248

|
|
|
Re: Can't start MySQL
Looking at mysqld.log seems that the mysql server is correctly started...
Some other thing you can try:
- look at the /var/log/messages (less messages | grep mysqld)
- for some reason it cannot access /var/lib/mysql/mysql.sock so check if it exist. If you have installed mysql from repos it should be there, otherwise try to find it on your filesystem and change /etc/my.cnf accordingly
If all of this fails, as last thing you can try to reinstall mysql with 'yum reinstall mysql mysql-server'. After that I have no other ideas, but you can always file a ticket in bugzilla.
|

7th September 2012, 08:33 AM
|
 |
Registered User
|
|
Join Date: Oct 2009
Location: In the Rain
Posts: 134

|
|
|
Re: Can't start MySQL
Try
Code:
su -
services mysqld status
__________________
Live and let live bla bla bla I hate it.
My words: Eat and let me Eat some delicious menu:p
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 22:01 (Tuesday, 21-05-2013)
|
|
 |
 |
 |
 |
|
|