首页 > 代码库 > mysql安装

mysql安装

Mysql:步骤

1、~]# yum -y install mysql-server

2、[root@mysql_httpd ~]# tail -20 /var/log/mysqld.log

3、161112 17:21:19 [ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘mysql.host‘ doesn‘t exist

4、执行mysql_install_db

5、重启就可以了


man 一下 mysql_install_db

DESCRIPTION

       mysql_install_db initializes the MySQL data directory and creates the system tables that it contains, if they do not exist.

       mysql_install_db is a shell script and is available only on Unix platforms.

 

 Because the MySQL server, mysqld, needs to access the data directory when it runs later, you should either run

       mysql_install_db from the same system account that will be used for running mysqld or run it as root and use the --user option

       to indicate the user name that mysqld will run as. It might be necessary to specify other options such as --basedir or

       --datadir if mysql_install_db does not use the correct locations for the installation directory or data directory. For

       example:


           shell> bin/mysql_install_db --user=mysql \

                    --basedir=/opt/mysql/mysql \

                    --datadir=/opt/mysql/mysql/data


本文出自 “Linux” 博客,请务必保留此出处http://ridingonhorse.blog.51cto.com/11265295/1872192

mysql安装