mysql 5.1编译参数和编译方法
一。下載:
??? 1.wget
??? 2.解壓
二。編譯:
??? 1.參數:
???
??./configure?\--prefix=/usr/local/mysql?\ --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock?\ --localstatedir=/usr/local/mysql/data?\ --enable-assembler?\ --enable-thread-safe-client?\ --with-mysqld-user=mysql?\ --with-big-tables?\ --without-debug?\ --with-pthread?\ --with-extra-charsets=complex?\ --with-readline?\ --with-ssl?\ --with-embedded-server?\ --enable-local-infile?\ --with-plugins=partition,innobase?\--with-plugin-PLUGIN?\ --with-mysqld-ldflags=-all-static?\ --with-client-ldflags=-all-static2.make?&&?make?intall3.復制mysql配置文件,此處為測試,使用占用資源最少的small.cnfcp?my-small.cnf?/etc/my.cnf4.建立安裝文件目錄。并把文件夾的屬主遞歸改為mysql
? mkdir -p /usr/local/mysql
? chown -R mysql.mysql /usr/local/mysql/
? 5.安裝數據庫:
? /usr/local/mysql/bin/mysql_install_db --user=mysql
?6.修復警告
WARNING: The host 'ser200' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
141018 15:29:28 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
141018 15:29:28 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h ser200 password 'new-password'
VI修改hosts文件,增加mysql
[root@ser200 data]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1?????????????? mysql ser150??? localhost
::1???????????? localhost6.localdomain6 localhost6
7.增加環境變量mysql路徑
[root@ser200 data]# echo "export PATH=$PATH:/usr/local/mysql/bin">> /etc/profile
[root@ser200 data]# . /etc/profile
[root@ser200 data]# echo $PATH
8.增加mysql 自啟動和init.d的服務器啟動2種方式
[root@ser200 data]# cp /home/oldboy/tools/mysql-5.1.73/support-files/mysql.server /etc/init.d/mysqld
[root@ser200 data]# chmod 700 /etc/init.d/mysqld
[root@ser200 data]# ll /etc/init.d/mysqld
-rwx------ 1 root root 12533 Oct 18 15:54 /etc/init.d/mysqld
===========================================================
[root@ser200 data]# chkconfig --add mysql
[root@ser200 data]# chkconfig --list|grep mysqld
mysqld????????? 0:off?? 1:off?? 2:on??? 3:on??? 4:on??? 5:on??? 6:off
9.刪除mysql庫user表多余的用戶
mysql> select user,host from user;?? ?
+------+-----------+
| user | host????? |
+------+-----------+
| root | 127.0.0.1 |
|????? | localhost |
| root | localhost |
|????? | ser200??? |
| root | ser200??? |
+------+-----------+
5 rows in set (0.00 sec)
mysql> drop user ""@localhost
mysql> drop user ""@ser200
mysql>drop user root@ser200
mysql> drop user root@ser200
轉載于:https://blog.51cto.com/txidc/1565365
總結
以上是生活随笔為你收集整理的mysql 5.1编译参数和编译方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php开启与关闭错误提示
- 下一篇: mysql innodb 数据恢复