centos7安装mysql
2017-11-23 11:00
253 查看
最近看到一篇写安装mysql的blog,感觉很好,做了一个自动化安装脚本,方便以后的安装。这个脚本有个缺陷就是:必须在执行完成后,必须自己敲一下回车。然后将完成了blog所说的安装mysql和相关配置内容。PS.将root用户的密码,设置为了root。
参考地址:
http://blog.csdn.net/qinglu000/article/details/43734471
https://www.cnblogs.com/starof/p/4680083.html
mysql下编码是一个比较棘手的问题。这里小结一下。
http://blog.csdn.net/guchuanhang/article/details/78612536
#!/bin/bash #install mysql. echo y | yum install mysql if [ $? -ne 0 ];then echo "yum install mysql failed" exit 1 fi #download mysql-server wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm if [ $? -ne 0 ];then echo "wget is not installed" yum -y install wget wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm if [ $? -ne 0 ];then echo "download mysql-server failed." exit 1 fi fi #install mysql-server rpm -ivh mysql-community-release-el7-5.noarch.rpm if [ $? -ne 0 ];then echo "rpm -ivh mysql-community-release-el7-5.noarch.rpm failed" exit 1 fi #install mysql-community-server yum install -y mysql-community-server if [ $? -ne 0 ];then echo "rpm -ivh mysql-community-server failed" exit 1 fi #install mysql-devel yum -y install mysql-devel if [ $? -ne 0 ];then echo "yum install mysql-devel failed" exit 1 fi #set character-set in /etc/my.cnf if [ ! -f "/etc/my.cnf" ];then echo "/etc/my.cnf doesn't exists. set character-set failed." exit 1 fi echo "[mysql]">> /etc/my.cnf echo "default-character-set =utf8">> /etc/my.cnf #restart mysql service mysqld restart if [ $? -ne 0 ];then echo "service mysqld restart failed." exit 1 fi # execute sql modify password to root #grant all table permission to root user in any IP. echo -e "\n" | mysql -u root -p -e " USE mysql; grant all privileges on *.* to root@'%'identified by 'root'; UPDATE user SET Password = password ('root') WHERE User = 'root' ; flush privileges; quit"
参考地址:
http://blog.csdn.net/qinglu000/article/details/43734471
https://www.cnblogs.com/starof/p/4680083.html
mysql下编码是一个比较棘手的问题。这里小结一下。
http://blog.csdn.net/guchuanhang/article/details/78612536
相关文章推荐
- Centos7 RPM 安装 mysql5.7
- centOS7安装mysql+jdk+tomcat
- CentOS7 安装mysql
- CentOS7 安装mysql
- CentOS7 安装mysql
- CentOS7安装openjdk、tomcat和mysql流程介绍
- CentOS7 安装LNMP(Linux+Nginx+MySQL+PHP)
- centos7 下手动安装MySQL-5.6.32-1.linux_glibc2.5.x86_64.rpm-bundle
- centos7 mysql5.6 安装
- centos7 yum安装 mysql 5.6
- Centos7 下Mysql5.7.18的安装和简单主从
- centos7安装mysql(实则安装的mariadb)
- 17090701_CentOS7(64)下MySQL卸载、安装与配置
- CentOS7上 pip install MySQL-python 安装失败(error: command 'gcc' failed with exit status 1)的解决办法
- centos7安装并配置mysql
- CENTOS7安装MYSQL
- Linux安装mysql------>CentOs7安装mysq
- centos7安装mysql
- Centos7中安装Mysql及配置
- centos7安装jdk+tomcat+nginx+mysql