我并没发现我的台式机(ubuntu 13.04)居然默认安装了mysql,我直接在mysql观望上下载的编译好的包,解压,mv 到/usr/local/mysql.然后很流利的根据以往的经验来配置。结果,居然没有起来。
于是,我看了下环境变量,我没有把mysql/bin 加入到环境变量,于是我手动一敲:mysql 报了进程locked什么错误。完了,我输入sudo dpkg -l |grep mysql 哗哗的列出一大堆。
我看都懒得看,直接卸载:sudo apt-get autoremove mysql* 管它什么东西,全删了。
查看/usr/bin下面N 多关于mysql的配置文件,不管,rm -f mysql*
在/根目录下看看还有没有与mysql 有关的东西,全删。
删的差不多了,我就执行复制到/etc/init.d/mysql.server(根据mysql安装包里的安装说明操作叫INSTALL-****)。
Starting MySQL
. * The server quit without updating PID file (/usr/local/mysql/data/libin-H61-S3.pid).
我进入到/usr/local/mysql/data/ 查看libin-H61-S3.erro 显示找不到libaio.so.1.
没有我就装上吧。
sudo apt-get install libaio-dev
装好之后再启动,还是提示 Starting MySQL
. * The server quit without updating PID file (/usr/local/mysql/data/libin-H61-S3.pid).
再看错误日志:2013-06-24 15:54:46 15952 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
130624 15:54:46 mysqld_safe mysqld from pid file /usr/local/mysql/data/libin-H61-S3.pid ended
这里我曾经删除过mysql用户,所有初始化一下就ok.
到mysql目录下, scripts/mysql_install_db --user=mysql
看到成功的提示后,就木问题了。
加入环境变量后,输入mysql
root@libin-H61-S3:/usr/local/mysql/data# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
好熟悉的界面啊,哈哈哈哈。