编译式安装MYSQL

 

安装所需组件

实际上只需要这四个配置即可 

升级boot开始

升级结束

重新执行cmake

make && make install

 启动mysql 发现启动失败

#####原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下,当然会找不到命令,我们需要做的就是映射一个链接到/usr/bin目录下,相当于建立一个链接文件。

新增mysql用户组

新增mysql用户

 

创建目录

修改mysql配置文件

 

/etc/my.cnf
chown -R -v mysql:mysql /usr/local/mysql //设置目录的权限
mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data  //初始化mysql

   

注:在下载boost时由于网速很慢,故采用了百度云离线下载功能先把软件下载到本地,然后上传,结果在mac中测试时发现sz命令无法使用,用iterm2都没有解决掉这个问题,后来才用了scp Downloads/boost_1_59_0.tar.gz root@192.168.1.254上传成功

如果遗失密码,可按以下步骤操作:

vim /etc/my.cnf	[mysqld]节点下添加 skip-grant-tables 
	重启mysql,进入mysql
	use mysql;
	update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';//仅mysql5.7支持的写法
	flush privileges;
	vim /etc/my.cnf	[mysqld]节点下删除 skip-grant-tables
	重启mysql
		进入后出现提示 You must reset your password using ALTER USER statement before executing this statement
			set global validate_password_policy=0;
			set global validate_password_length=1;
			set global validate_password_mixed_case_count=2;
			SET PASSWORD = PASSWORD('123456');
			flush privileges;
			重启mysql

  添加远程登录权限

grant all privileges on *.* to root@"%" identified by '123456' with grant option;
	vim  /etc/my.cnf
	添加 bind-address = 0.0.0.0
	firewall-cmd --zone=public --add-port=3306/tcp --permanent
	systemctl restart firewalld.service

  

http://www.cnblogs.com/xiongpq/p/3384681.html

http://www.linuxidc.com/Linux/2015-08/121667.htm

原文地址:https://www.cnblogs.com/isuben/p/6869273.html