时间:2021-07-01 10:21:17 帮助过:25人阅读
2、安装mysql
tar -xvzf mysql-5.6.38-linux-glibc2.12-i686.tar.gz
mv mysql-5.6.38-linux-glibc2.12-i686/ mysql
执行命令:groupadd mysql和useradd -r -g mysql mysql
数据库数据默认目录datadir=/var/lib/mysql,可通过vim /etc/my.cnf 查看
修改后的目录是 mkdir -p data,没有创建文件夹,有不创建
chown -R mysql:mysql ./
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[root@localhost mysql]# chown -R root:root .
[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
linux下mysql安装
标签:pad 下载 basedir style data serve ror inux images