I downloaded mysql-5.1.44.tar.gz and installed it by issuing the following commands:
$ ./configure
$ make
$ make install
Everything installed without any error. Next, I tried to start the mysql server by issuing the following command:
$ mysqld_safe --user=mysql &
100310 13:25:56 mysqld_safe Logging to '/usr/local/var/perfportal2.err'.
100310 13:25:56 mysqld_safe Starting mysqld daemon with databases from /usr/local/var
100310 13:25:56 mysqld_safe mysqld from pid file /usr/local/var/perfportal2.pid ended
$ cat /usr/local/var/myserver.err
100310 13:25:56 mysqld_safe Starting mysqld daemon with databases from /usr/local/var
/usr/local/libexec/mysqld: Table 'mysql.plugin' doesn't exist
100310 13:25:56 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
100310 13:25:56 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
100310 13:25:56 mysqld_safe mysqld from pid file /usr/local/var/perfportal2.pid ended
My guess is the installation process did not create the data directory.
Any suggestions about what I should do?
Best Answer
If you ran
make install
and already had themysql-server
package installed, chances are you had a pre-existingmysql
database schema in /var/lib/mysql. The version included with RHEL5 is 5.0.77, which could explain the mysql-upgrade error, as that script updates the schema between MySQL versions. The error could also be very similar if you did not create the initial schema as part of your installation.If you're going to compile from source and not specify installation locations, you need to remove the system packages of mysql first. If you want to maintain both the system packages and the source installation, which there is sometimes argument for, you need to be careful not to stomp all over the system package. That typically means installing your source in a location such as
/usr/local/mysql
as opposed to the default of/usr/local
. You can accomplish this with./configure --prefix=/usr/local/mysql
. There are more details here and best practices that I'm not going to elaborate further on.While there can be good reasons to compile from source, you might reconsider yours, as it may not be necessary for you.
rpm -qa | grep mysql
will display all packages currently installed. Probablymysql-server
andmysql-client
.Otherwise, you didn't follow the procedure from the documentation. Even if you did, you will have to repeat it after removing the MySQL packages.
From
INSTALL-SOURCE
, which was included in the mysql-5.1.44 tarball: