Home > Database > Mysql Tutorial > Ubuntu下MySQL的一些基本设置

Ubuntu下MySQL的一些基本设置

WBOY
Release: 2016-06-07 15:35:16
Original
1229 people have browsed it

1、查看MYSQL的编码 showvariableslike '%character%' ; 2、修改编码 vim/etc/mysql/my.cnf 在[client]下追加:default-character-set=utf8 在[mysqld]下追加:character-set-server=utf8 default-character-set=utf8 3、mysql更改密码 a、mysqladmin -u用户

1、查看MYSQL的编码

show variables like '%character%'

2、修改编码

vim/etc/mysql/my.cnf

在[client]下追加:default-character-set=utf8

在[mysqld]下追加:character-set-server=utf8

      default-character-set=utf8

3、mysql更改密码

a、mysqladmin -u用户名 -p旧密码 password 新密码

b、UPDATE mysql.user SET password=PASSWORD(’新密码’) WHERE User=’root’;

4、mysql丢失root密码是找回密码

mysqld_safe --skip-grant-tables&

mysql -u root mysql

mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';

mysql> FLUSH PRIVILEGES;


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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template