源码包官网下载:http://dev.mysql.com/downloads/
MySQL手册官网下载:http://dev.mysql.com/doc/
安装ncurses:
1、tar -zxvf ncurses-5.9.tar.gz
2、cd ncurses-5.9.tar.gz ; ./configure; make clean; make; make install
修改时区和时间为东八区北京时间
http://blog.csdn.net/dmtnewtons_blog/article/details/13510187
安装MySQL:
1、tar -zxvf mysql-5.1.62.tar.gz
2、cd mysql-5.1.62; ./configure --prefix=/usr/local/mysql --with-plugins=csv,innobase,myisam,heap,innodb_plugin
3、make clean; make
4、make install;
5、cp support-files/my-large.cnf /etc/mysql/my.cnf
6、nano -w /etc/mysql/my.cnf
[1] 将 skip-external-locking 和 thread_cache_size 注掉
[2] 注意[mysqld_safe] 和 [mysqld] 中的 socket 和 pid-file 的运行目录,如:
[mysqld_safe]
socket = /var/mysqld/mysqld.sock
[mysqld]
pid-file = /var/mysqld/mysqld.pid
socket = /var/mysqld/mysqld.sock
7、cd /usr/local/mysql/bin/
8、groupadd -g mysql; useradd -g mysql; chown -R mysql:mysql *;
9、./mysql_install_db --user=mysql
10、./mysqladmin -u root password '111111'
11、./mysqld_safe --user=mysql
若启动失败,ps awx|grep mysql 将mysql进程kill掉,换种方式启动:/usr/local/mysql/shared/mysql/mysql.server start
12、当MySQL服务启动后,进入数据库:
[1] /usr/local/mysql/bin/mysql
[2] use mysql;
[3] 添加访问用户及权限:grant all on *.* to 'root'@'localhost' identified by '111111';
若需要远程登录:grant all on *.* to 'admin'@'%' identified by '222222';
[4] delete from user where user='' or password='';
13、添加开机启动:
打开文件:nano -w /etc/rc.local
在exit之前加入行:/usr/local/mysql/shared/mysql/mysql.server start