下載
到以下MySQL官網(wǎng)(http://dev.mysql.com)下載Linux通用版本的MySQL安裝包。
安裝
安裝需要執(zhí)行以下命令
shell> apt-cache search libaio
shell> apt-get install libaio1
shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> mkdir mysql-files
shell> chown mysql:mysql mysql-files
shell> chmod 750 mysql-files
shell> bin/mysqld --initialize --user=mysql
shell> bin/mysql_ssl_rsa_setup
shell> bin/mysqld_safe --user=mysql &
shell> cp support-files/mysql.server /etc/init.d/mysql.server
shell> systemctl enable mysql
shell> systemctl start mysql
配置環(huán)境
配置/etc/profile文件
添加以下內(nèi)容:
export PATH=/usr/local/mysql/bin:$PATH
保存后執(zhí)行以下命令:
shell> source /etc/profile
配置允許遠(yuǎn)程連接
登錄到mysql下
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
flush privileges;
遠(yuǎn)程登錄
shell> mysql -h 192.168.1.10 -P3306 -uroot -p