设为首页 加入收藏

TOP

Centos6源码部署MySQL5.6(三)
2015-11-21 01:45:45 来源: 作者: 【 】 浏览:3
Tags:Centos6 源码 部署 MySQL5.6
sql.com

?

Support MySQL by buying support/licenses at http://shop.mysql.com

?

New default config file was created as /usr/local/mysql/my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

?

WARNING: Default config file /etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, or use the

?

--defaults-file argument to mysqld_safe when starting the server


?


[root@localhost ~]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost ~]# chmod 755 /etc/init.d/mysqld
查看mysqld服务是否设置为开机启动
[root@localhost ~]# chkconfig --list|grep mysqld
设置为开机启动
[root@localhost ~]# chkconfig mysqld on

启动mysql数据库,会输出一系列有用的信息,告诉你接下去如何初始化mysql

[root@CentOS mysql]# service mysqld start

按照上述英文,我们来初始化管理员root的密码

[root@localhost ~]# /usr/local/mysql/bin/mysqladmin -u root password 'yourpassword'

此处yourpassword设置为 manager

?

?

众所周知,mysql有两种帐号类型,即localhost和%,前者限本机连接mysql,后者可用于其它机器远程连接mysql

最后,处理帐号登录问题,让root帐号密码可以本地和远程连接使用

[root@localhost ~]# /usr/local/mysql/bin/mysql -u root -p #敲入该命令后,屏幕会提示输入密码,输入上一步设置的yourpassword

删除root密码为空的记录

mysql> use mysql;

mysql> delete from user where password='';

mysql> flush privileges;

配置mysql允许root远程登录 #登录

mysql> grant all privileges on *.* to root@'%' identified by "manager";

mysql> flush privileges;

mysql> select User,Password,Host from user;

?

上述命令如果执行成功

?

mysql> quit

?

?

至此,mysql安装已经全部结束.

?

首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MySQL多表连接删除问题 下一篇MongoDB与MySQL的操作对比表及区..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: