wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.12-linux-glibc2.12-x86_64.tar
然后按照官方文档进行安装配置https://dev.mysql.com/doc/refman/8.0/en/binary-installation.html
问题1
./mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
#缺少aio库,这个在文档上说明
yum install libaio*
image.png
问题2
MY-011011
删除mysql数据文件夹下的东西,并执行如下代码进行初始化
./bin/mysqld --initialize-insecure --user=mysql
问题3
Could not create unix socket lock file /var/lib/mysql/mysql.sock.lock.
总结:在进行初始化之前,确保/etc/my.cnf的配置中涉及到的文件或文件夹(日志、数据、pid等)都有mysql:mysql的相应权限(读、写、执行),否则在初始化时的mysql用户无法进行相关文件或文件夹的读写操作。
授权远程访问
CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%';
网友评论