下载安装
> wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
> rpm -ivh mysql-community-release-el7-5.noarch.rpm
> yum install mysql-community-server
启动mysql服务
>service mysqld restart
进入mysql客户端(无密码):
>mysql -uroot -p
切换库
>use mysql
删除旧用户允许远程访问:
>delete from user;
>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
此时仍不生效需要执行下面()
>flush privileges;
mysql安装初始化完成,例子中允许root远程访问生产环境请不要使用,仅是个人测试使用。