一、下載地址mysql
二、安裝mysqllinux
tar -xvzf mysql-5.6.38-linux-glibc2.12-i686.tar.gz sql
mv mysql-5.6.38-linux-glibc2.12-i686/ mysql數據庫
執行命令:groupadd mysql和useradd -r -g mysql mysqlvim
數據庫數據默認目錄datadir=/var/lib/mysql,可經過vim /etc/my.cnf 查看ui
修改後的目錄是 mkdir -p data,沒有建立文件夾,有不建立spa
chown -R mysql:mysql ./3d
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/dataserver
[root@localhost mysql]# chown -R root:root .blog
[root@localhost mysql]# chown -R mysql:mysql data
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysql
[root@localhost bin]# ./mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@localhost bin]# ./mysql -u root mysql
mysql> quit