在启动mysql过程中,出现下面的提示:
linux-spru:/home/zhang # /etc/init.d/mysql start
Creating MySQL privilege database...
Installing MySQL system tables...
120310 19:57:26 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
120310 19:57:28 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h linux-spru.site password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
rcmysql start
You can test the MySQL daemon with mysql-test package
Please report any problems with the /usr/bin/mysqlbug script!
Starting service MySQL warning: /var/run/mysql/mysql.sock didn't appear within 30 seconds
chmod: cannot access `/var/run/mysql/mysqld.pid': No such file or directory
接下来执行:
linux-spru:/usr/local # mysqld_safe
120310 20:23:10 mysqld_safe Logging to '/var/log/mysql/mysqld.log'.
120310 20:23:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120310 20:23:10 mysqld_safe mysqld from pid file /var/lib/mysql/linux-spru.site.pid ended
linux-spru:/usr/local # /etc/init.d/mysql start
Starting service MySQL warning: /var/run/mysql/mysql.sock didn't appear within 30 seconds
chmod: cannot access `/var/run/mysql/mysqld.pid': No such file or directory
权限问题:
chown -R mysql:mysql /var/lib/mysql
linux-spru:/usr/local/lib # service mysqld start
service: no such service mysqld
ok 成功启动
修改默认密码:
mysqladmin -uroot password 'zhangxin'