yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake
[root@server182 ~]# groupadd mysql [root@server182 ~]# useradd -r -g mysql mysql mysql-5.6.10.tar.gz下載:http://download.csdn.net/download/wormsnake/5116910 [root@server182 ~]# tar -zxvf mysql-5.6.10.tar.gz [root@server182 ~]# cd mysql-5.6.10 [root@server182 mysql-5.6.10]# cmake . [root@server182 mysql-5.6.10]# make && make install
-------------------------默認狀況下是安裝在/usr/local/mysqlmysql
[root@server182 ~]# chown -R mysql.mysql /usr/local/mysql [root@server182 ~]# cd /usr/local/mysql/scripts [root@server182 ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data [root@server182 ~]# cd /usr/local/mysql/support-files [root@server182 support-files]# cp mysql.server /etc/rc.d/init.d/mysql [root@server182 support-files]# cp my-default.cnf /etc/my.cnf [root@server182 ~]# chkconfig -add mysql [root@server182 ~]# chkconfig mysql on [root@server182 ~]# service mysql start
Starting MySQL SUCCESS!c++
mysqladmin -u root password '123456'
mysql -u root -p
多是你的賬號不容許從遠程登錄,只能在localhost。這個時候只要在localhost的那臺電腦,登入mysql後,更改 "mysql" 數據庫裏的 "user" 表裏的 "host" 項,從"localhost"改稱"%" sql
Sql代碼數據庫
mysql -u root -pvmwaremysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user;
例如,你想myuser使用mypassword從任何主機鏈接到mysql服務器的話。服務器
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; FLUSH PRIVILEGES;