源碼包官網下載: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