[gophper]配置mysql数据库
centos安装配置mysql数据库。
安装mysql
yum install -y mysql-server mysql mysql-devel
启动
service mysqld start
设置开机启动
chkconfig mysqld on
修改密码
mysqladmin -u root password '111111'
登陆
mysql -u root -p
创建数据库
create database gophper;
mysql登录报错“Access denied for user ‘root’@‘localhost’ (using password: YES”的处理方法
# /etc/init.d/mysqld stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; mysql> FLUSH PRIVILEGES; mysql> quit # /etc/init.d/mysqld restart # mysql -uroot -p Enter password: <输入新设的密码newpassword> mysql>