您的位置:首页 > 运维架构 > Linux

mysql window/linux 安装及配置

2016-06-17 00:00 555 查看
摘要: mysql下面的安装教程mysql各个版本官网下载地址http://dev.mysql.com/downloads/mysql/各个版本安装请看官方教程http://dev.mysql.com/doc/refman/5.7/en/installing.html请选择自己安装的版本window zip安装下载window zip包解压到出来我安装在D盘中,然后在在文件中新建一个data文件夹
修改my-default.ini 配置配置中反斜杠的使用,你可以在官方文档找到这个说明进入bin目录执行初始化操作按照官方步骤这里需要开启服务首次(Starting the Server for the First Time)然后安装安装完成后 开启由于mysql对于安全加强了,刚安装的时候会有一个初始的密码,该密码会记录在你创建的data/目录里面的一个xxxx.err文件中拷贝密码的时候别吧空格拷进去了登入mysql我这里已经把我的密码修改成了root了修改mysql密码
mysqladmin -u root -p password root1234 回车 输入旧的密码我这里把原来的旧密码root改成了root1234了到此完成了mysql在window zip的安装以及配置了
这个是官方的安装文档
http://dev.mysql.com/doc/refman/5.7/en/windows-installation.html如果你中途安装有问题就remove掉mysql吧重新安装吧linux下mysql的安装来看官方文档吧http://dev.mysql.com/doc/refman/5.7/en/linux-installation-rpm.html初始密码和修改密码A superuser account
'root'@'localhost'
is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command for RHEL, Oracle Linux, CentOS, and Fedora systems:
shell> [code=plain]sudo grep 'temporary password' /var/log/mysqld.log
[/code] Use the following command for SLES systems:
shell> [code=plain]sudo grep 'temporary password' /var/log/mysql/mysqld.log
[/code] The next step is to log in with the generated, temporary password and set a custom password for the superuser account:
shell> [code=plain]mysql -uroot -p
[/code]

mysql>
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
这个也是官方 ,在linux下面的mysql如果需要远程访问的话需要配置ip地址的你想root使用password从任何主机连接到mysql服务器的话。
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.100.120的主机连接到mysql服务器,并使用mypassword作为密码
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.120' IDENTIFIED BY 'password’ WITH GRANT OPTION;
如果你有什么问题话 请留言吧
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: