MySQL not running

Hello all,

I face an issue when starting MySQL. Each time I run status it is said MySQL is not running. I tried to search for this issue but until now I couldn’t find any answer. Also I tried to install a different version of MySQL but still the same issue.

Please see the below for the error file.
Code:
130617 13:45:50 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
2013-06-17 13:45:51 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp se
2013-06-17 13:45:51 23252 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/libexec/mysqld: Table 'mysql.plugin' doesn't exist
2013-06-17 13:45:51 23252 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2013-06-17 13:45:51 23252 [Note] InnoDB: The InnoDB memory heap is disabled
2013-06-17 13:45:51 23252 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-06-17 13:45:51 23252 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-06-17 13:45:51 23252 [Note] InnoDB: Not using CPU crc32 instructions
2013-06-17 13:45:51 23252 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-06-17 13:45:51 23252 [Note] InnoDB: Completed initialization of buffer pool
2013-06-17 13:45:51 23252 [Note] InnoDB: Highest supported file format is Barracuda.
2013-06-17 13:45:51 23252 [Note] InnoDB: Log scan progressed past the checkpoint lsn 1453445
2013-06-17 13:45:51 23252 [Note] InnoDB: Database was not shutdown normally!
2013-06-17 13:45:51 23252 [Note] InnoDB: Starting crash recovery.
2013-06-17 13:45:51 23252 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-06-17 13:45:51 23252 [Note] InnoDB: Restoring possible half-written data pages
2013-06-17 13:45:51 23252 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1600607
2013-06-17 13:45:51 23252 [Note] InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 5
InnoDB: Apply batch completed
2013-06-17 13:45:52 23252 [Note] InnoDB: 128 rollback segment(s) are active.
2013-06-17 13:45:52 23252 [Note] InnoDB: Waiting for purge to start
2013-06-17 13:45:52 23252 [Note] InnoDB: 5.6.12 started; log sequence number 1600607
2013-06-17 13:45:52 23252 [Note] Server hostname (bind-address): '*'; port: 3306
2013-06-17 13:45:52 23252 [Note] IPv6 is available.
2013-06-17 13:45:52 23252 [Note]   - '::' resolves to '::';
2013-06-17 13:45:52 23252 [Note] Server socket created on IP: '::'.
2013-06-17 13:45:52 23252 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
130617 13:45:52 mysqld_safe mysqld from pid file /var/db/mysql/ASGH.pid ended
 
Well, judging from the logfile it seems you haven't configured MySQL just yet and now it's using it's default values. So the best way to start is to set up MySQL, start by setting up a configuration file (my.cnf), you can find good examples for it in /usr/local/share/mysql.

You may also want to look into mysql_config(1).

And finally, to set up your database environment in /var/db/mysql, the so called system tables, you'd want to look into mysql_install_db, this script takes care of setting up the initial system tables which your setup is currently missing.
 
ShelLuser said:
Well, judging from the logfile it seems you haven't configured MySQL just yet and now it's using it's default values. So the best way to start is to set up MySQL, start by setting up a configuration file (my.cnf), you can find good examples for it in /usr/local/share/mysql.

You may also want to look into mysql_config(1).

And finally, to set up your database environment in /var/db/mysql, the so called system tables, you'd want to look into mysql_install_db, this script takes care of setting up the initial system tables which your setup is currently missing.

Thanks for your fast reply.

Regarding the my.cnf I read it’s not necessary as MySQL will use default values. However I copy one of example and edit it as below:
Code:
# For advice on how to change settings please see
# [url]http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html[/url]
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
 basedir = /usr/local/data/mysql/mysqldatabase/
 datadir = /usr/local/data/mysql/mysqldatabase/
# port = .....
# server_id = .....
# socket = .....                                      
                                                      
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
 join_buffer_size = 128M                              
 sort_buffer_size = 2M                                
 read_rnd_buffer_size = 2M                            
                                                      
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
and for the second step I get the below result when I run mysql_install_db:

Code:
mysql_install_db
FATAL ERROR: Could not find ./bin/my_print_defaults

If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
 
It would seem that you have other issues which seem to interfere with MySQL as a whole, my theory at this time is that this limitation (or whatever it is) also disrupted the initial installation process.

First: Which version of FreeBSD are you using? Also, just to rule things out: How exactly did you install MySQL, and which version did you get?

Finally, also important to know: what do you see when using this command $ which my_print_defaults?
 
ShelLuser said:
It would seem that you have other issues which seem to interfere with MySQL as a whole, my theory at this time is that this limitation (or whatever it is) also disrupted the initial installation process.

First: Which version of FreeBSD are you using? Also, just to rule things out: How exactly did you install MySQL, and which version did you get?

Finally, also important to know: what do you see when using this command $ which my_print_defaults?

The FreeBSD version is 9.0. I try first using the package and this issue happens; then I deinstall and I try through ports and install the latest version 5.6. Also I tried before many versions, 5 and above, and all have the same issue. Please see the below result for the command
Code:
# which my_print_defaults
/usr/local/bin/my_print_defaults

Thanks for your support.
 
If /usr/local/bin/my_print_defaults is the location of my_print_defaults, your basedir is likely to be /usr/local.

my.cnf:
Code:
..
basedir = [FILE]/usr/local[/FILE]
datadir = [FILE]/var/db/mysql[/FILE]
..

You have to double check the owner:group of /var/db/mysql, including files and sub folders. It must be mysql:mysql. Please post the output of ls -al /var/db/mysql.
 
Back
Top