

##########################################################################################################

# 14. װݿ⡢ͻ  https://juejin.cn/post/6844903609231130631
find / -name my.cnf ļ

	һװͻ
		yum install mysql

	һװݿ
		rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
		# 鿴ǰõmysqlװԴ
		yum repolist enabled | grep "mysql.*-community.*"

		yum -y install mysql-community-server
		#װ

		#鿴汾
		mysql -V

		mysql  Ver 14.14 Distrib 5.6.40, for Linux (x86_64) using  EditLine wrapper 

		#һ£¼Ҫ
		/usr/bin/mysql

		#뿪
		systemctl enable mysqld

		#mysql
		systemctl start mysqld

	ʼ
		ִ mysql_secure_installation

		#γ⡣

		Set root password? [Y/n]
		Ƿrootû (yõ¼롿)

		Remove anonymous users? [Y/n]
		Ƿɾû (y)

		Disallow root login remotely? [Y/n]
		ǷֹrootԶ̵¼ (n)

		Remove test database and access to it? [Y/n]
		Ƿɾtestݿ(y)

		Reload privilege tables now? [Y/n]
		Ƿ¼ȨϢ (y)

	ȨԶû¼

		# Ƚmysql
		mysql -uroot -p

		# Ȩ(rootû)ԶȨ()
		GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Զ̵¼' WITH GRANT OPTION;

		FLUSH PRIVILEGES;

		# ʹõԶ̵¼û(Ƽ)
		GRANT ALL PRIVILEGES ON *.* TO 'û'@'%' IDENTIFIED BY 'Զ̵¼' WITH GRANT OPTION;

		FLUSH PRIVILEGES;

		ֻȨޣMysqlͬʱӿֻȨ
		GRANT SELECT ON dbname.* to û@'%' IDENTIFIED BY 'Զ̵¼';

		FLUSH PRIVILEGES;