rpm -qa | grep mariadb
[root@x86b ~]# cat /etc/redhat-release CentOS Stream release 8
#使用wget下载mysql(el8) wget http://repo.mysql.com/mysql80-community-release-el8.rpm
yum -y install mysql80-community-release-el8.rpm
yum -y install mysql-community-server
(1)修改配置文件。vim /etc/my.cnf添加配置
symbolic-links=0 # 关闭mysql的符号链接 #skip-grant-tables # 忽略密码验证 port=3306 # mysql监听端口 character-set-server=utf8 # 指定mysql的字符集为utf8 lower_case_table_names=1 #(先不用加)
systemctl start mysqld #一定要启动服务! systemctl status mysqld #查看服务状态
grep "password" /var/log/mysqld.log
mysql -u root -p <密码> SHOW VARIABLES LIKE 'validate_password.%';
set global validate_password.policy=0; //设置复杂度为0 set global validate_password.length=6; //设置最小长度6 set global validate_password.check_user_name=off; //设置用户名密码可以相同
INSTALL PLUGIN validate_password SONAME 'validate_password.so'
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
ALTER USER 'root'@'%' IDENTIFIED BY '123456';
# 选择数据库 use mysql; # 最后授权MySQL,允许远程用户登录访问MySQL update user set host = '%' where user = 'root'; select host, user from user; # 刷新权限 flush privileges;
netstat -an|grep 3306
show global variables like 'port';
show variables like 'skip_networking';
ps -ef | grep mysql pkill -9 mysqld
// 先执行: flush privileges; // 再执行修改密码命令就可以了: set password for root@localhost=password('你的密码');
GRANT ALL PRIVILEGES ON slurm_jobcomp_db.* TO slurm@'localhost'; FLUSH PRIVILEGES;
SELECT host,user,Grant_priv,Super_priv FROM mysql.user;
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root'; FLUSH PRIVILEGES;
useradd -s /sbin/nologin mysql mkdir /usr/local/mysql mkdir /usr/local/mysql/data
cmake \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ #安装目录 -DMYSQL_DATADIR=/usr/local/mysql/data \ #数据库存放目录 -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \ #Unix socket文件路径 -DWITH_MYISAM_STORAGE_ENGINE=1 \ #安装myisam存储引擎 -DWITH_INNOBASE_STORAGE_ENGINE=1 \ #安装innodb存储引擎 -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DENABLED_LOCAL_INFILE=1 \ #安装数据库分区 -DDEFAULT_CHARSET=utf8 \ #使用utf8字符 -DDEFAULT_COLLATION=utf8_general_ci \ -DMYSQL_USER=mysql \ -DMYSQL_TCP_PORT=3306 \ -DWITH_BOOST=/usr/local/boost
[mysqld] basedir=/usr/local/mysql # mysql安装目录 datadir=/usr/local/mysql/data # mysql数据存放目录 socket=/usr/local/mysql/mysql.sock # mysql.sock文件存放目录 user=mysql symbolic-links=0 # 关闭mysql的符号链接 skip-grant-tables # 忽略密码验证 [mysqld_safe] port=3306 # mysql监听端口 character-set-server=utf8 # 指定mysql的字符集为utf8 log-error=/usr/local/mysql/mysqld.log # 指定mysql的错误日志存放路径 pid-file=/usr/local/mysql/mysqld.pid # mysql的pid文件存放目录 # The end
chown -R mysql:mysql /usr/local/mysql
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld
chkconfig --add mysqld //把mysql添加到系统服务 chkconfig mysqld on //把mysql添加到开机自启动 chkconfig --list mysqld //查看mysql开机自启动状态
vim /etc/profile.d/mysql.sh export PATH=/usr/local/mysql/bin:$PATH source /etc/profile.d/mysql.sh
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
systemctl start mysqld(/etc/init.d/mysqld start) systemctl status mysqld
mysql -u root -p update mysql.user set authentication_string=password('123456') where user='root';
tar -zxvf ncurses-6.4.tar.gz ./configure --with-shared --without-debug --without-ada --enable-overwrite make && make install
tar -zxvf rpcsvc-proto-1.4.3.tar.gz ./autogen.sh ./configure make & make install
(4)openssl
(5)Package 'libtirpc', required by 'virtual:world', not found
解决方法:安装libtirpc-devel(https://rpmfind.net/linux/RPM/)
protected int terminal_set(EditLine el, const char *term) { int i; /*char buf[TC_BUFSIZE];*/ char *area; const struct termcapstr *t; sigset_t oset, nset; int lins, cols; --phpfensi.com (void) sigemptyset(&nset); (void) sigaddset(&nset, SIGWINCH); (void) sigprocmask(SIG_BLOCK, &nset, &oset); area = NULL;
然后重新编译即可
cmake ****** make && make install
。