这篇文章主要介绍“centos7二进制安装mysql5.7.25的过程”,在日常操作中,相信很多人在centos7二进制安装mysql5.7.25的过程问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”centos7二进制安装mysql5.7.25的过程”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!一.安装前系统环境检查1.关闭selinux
2.关闭防火墙3.centos 7 io调度系统是deadline模式,ssd硬盘需要改为noop模式
4.操作系统的限制
这里面最重要的两个参数是open files和max user processes编辑/etc/security/limits.conf,加入下面的内容5.numa6.创建用户组和用户7.做个软连接8.授权[root@mgr1 local]# chown mysql:mysql -R mysql9.创建mysql数据库的数据目录(datadir)10.给数据目录授权
11.配置/etc/my.cnf文件
12.初始化[root@mgr1 bin]# ./mysq免费主机域名ld –defaults-file=/etc/my.cnf –basedir=/usr/local/mysql –datadir=/data/mysql/ –user=mysql –initialize-bash: ./mysqld: /lib/ld-li免费主机域名nux.so.2: bad ELF interpreter: No such file or directory解决办法:[root@mgr1 bin]# yum install glibc.i686[root@mgr1 bin]# ./mysqld –defaults-file=/etc/my.cnf –basedir=/usr/local/mysql –datadir=/data/mysql/ –user=mysql –initialize./mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory解决办法:yum -y install libaio.so.1[root@mgr1 bin]# ./mysqld –defaults-file=/etc/my.cnf –basedir=/usr/local/mysql –datadir=/data/mysql/ –user=mysql –initialize./mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directoryyum install -y libnuma.so.1[root@mgr1 bin]# ./mysqld –defaults-file=/etc/my.cnf –basedir=/usr/local/mysql –datadir=/data/mysql/ –user=mysql –initialize./mysqld: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directoryyum install -y
libstdc++.so.6[root@mgr1 bin]# ./mysqld –defaults-file=/etc/my.cnf –basedir=/usr/local/mysql –datadir=/data/mysql/ –user=mysql –initialize启动:
[root@mgr1 bin]# ./mysqld_safe –defaults-file=/etc/my.cnf &[1] 7910[root@mgr1 bin]# 2019-02-17T07:47:24.044846Z mysqld_safe Logging to ‘/data/mysql/error.log’.2019-02-17T07:47:24.109848Z mysqld_safe Starting mysqld daemon with databases from /data/mysql2019-02-17T07:47:26.264358Z mysqld_safe mysqld from pid file /data/mysql/mgr1.pid ended查看初始化密码:[root@mgr1 bin]# cat /data/mysql/error.log |grep password2019-02-17T03:06:47.347886-05:00 1 [Note] A temporary password is generated for root@localhost: vjxL1c_F3*fd登录:[root@mgr1 bin]# ./mysql -uroot -p修改密码:root@db 03:10: [(none)]> set password=’root123′;Query OK, 0 rows affected (0.00 sec)root@db 03:12: [(none)]> alter user ‘root’@’localhost’ password expire never;Query OK, 0 rows affected (0.00 sec)root@db 03:13: [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)设置环境变量export PATH=$PATH:/usr/local/mysql/bin让它生效source /etc/profile到此,关于“centos7二进制安装mysql5.7.25的过程”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注云技术网站,小编会继续努力为大家带来更多实用的文章!
这篇文章给大家分享的是有关MySQL异常处理的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。针对存储过程 、触发器或函数内部语句可能发生的错误或警告信息,需要进行相关异常或称 例外的捕捉,然后作出相应的处理,异常处理的方式如…