Home > Database > Mysql Tutorial > mysql安装及root密码初始化_MySQL

mysql安装及root密码初始化_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:40:49
Original
1364 people have browsed it

bitsCN.com
安装mysql [root@sample ~]# yum -y install mysql-server  ← 安装MySQL[root@sample ~]# yum -y install php-mysql     ← 安装php-mysql配置mysql [root@sample ~]# /etc/init.d/mysqld stop           停止mysql服务[root@sample ~]# vim /etc/my.cnf                     mysql服务的配置文件[mysqld]    datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommended to prevent assorted security risksskip-grant-tables #添加这句话,这时候登入mysql就不需要密码symbolic-links=0 [root@sample ~]# /etc/init.d/mysqld start           启动mysql服务[root@sample ~]# mysql                                  登入mysqlmysql> USE mysql ;mysql> UPDATE user SET Password = password(‘new-password‘) WHERE User = ’root’ ;mysql> flush privileges ; mysql> quit在把 /etc/my.cnf 中 skip-grant-tables 注释了,恢复配置文件原样。   [root@sample ~]# /etc/init.d/mysqld restart           启动mysql服务 [root@sample ~]# mysql -u root -p                      输入密码 修改密码 原来的帐号:root,密码:root,修改成 fire [root@sample ~]# mysqladmin -u root -p password fire Enter password:
  bitsCN.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template