Linux(CentOS)安装MySQL

    部署Java Web项目第二步:安装MySQL。

    软件版本

    1.传输文件

rz

     2.解压文件

[root@localhost ~]# tar -xvf MySQL-5.6.27-1.el6.i686.rpm-bundle.tar

     3.安装文件

[root@localhost home]# rpm -ivh MySQL-server-5.6.27-1.el6.i686.rpm 
//部分输出
A random root password has been set. You will find it in '/root/.mysql_secret'. 
New default config file was created as /usr/my.cnf

     4.第一次登陆,其中默认密码在上面输出的文件'/root/.mysql_secret' 中。

[root@localhost home]# mysql -h127.0.0.1 -uroot -p

     5.修改密码

[root@localhost home]# mysqladmin -uroot -p password 123456
Enter password: 
Warning: Using a password on the command line interface can be insecure.

     6.到此MySQL服务安装完毕,可以再安装MySQL-client-5.6.27-1.el6.i686.rpm和MySQL-devel-5.6.27-1.el6.i686.rpm。

    7.执行sql脚本文件

mysql>  source /home/mysql.sql;

猜你喜欢

转载自wojiaowangtao.iteye.com/blog/2259366