How to install and configure Mysql5.5 and how to solve Chinese Garbled text quickly; how to install and configure mysql5.5

Source: Internet
Author: User

How to install and configure Mysql5.5 and how to solve Chinese Garbled text quickly; how to install and configure mysql5.5

1. Start the service

In windows, run the following command in the doscommand window:

Check whether the service is started: net help services

Start mysql service: net start mysql

Stop mysql service: net stop mysql

In bash in linux, enter the following command:

View service status: service mysqld status

Start mysql service: service mysqld start

Stop mysql service: service mysqld stop

2. Log in

Mysql-u [enter the user name here]-p [enter the password here]

3. Forget the administrator password.

Stop mysql service first

Enter mysqld -- skip-grant-tables. Then, the mysqld service is started.

Enter mysql-uroot in the command line to log on to the root user without a password.

Input: update mysql. user set password = PASSWORD ('[enter your new password here]') where user = 'root'

Input: flush privileges

Log out, restart the mysql service, and log on with the new password.

4. Create a database

Log on to the mysql console with the root account

View All databases: show databases;

Create database openfire;

Create a database administrator and assign permissions: grant all on openfire. * to openfire @ localhost identified by "openfire"

Switch Database: use openfire;

View all tables in the current database: show tables;

5. Simple permission Control

Use the root user to log on to the mysql Command Line

Add permissions:

Enter grant all on [database name + Table name *. *] to [user name] @ [IP address] identified by '[Password]'

Example: grant all on admin. * to otalk@172.17.100.156 identified by 'password01! '

The preceding statement means that otalk users can have all the access permissions for all tables in the admin database on the host with the IP address 172.17.100.156.

Remove permission:

Revoke all privileges on admin. users from otalk @ localhost

Mysql5.5 perfect solution to Chinese problems

Pause the mysql service and find the my. ini file in the Mysql installation directory,

Add a sentence under [client:

Default-character-set = utf8

Change the following two sentences under [mysqld:

Copy codeThe Code is as follows:
Character-set-server = utf8
Collation-server = utf8_general_ci

Then restart the mysql service.

Go to the mysql command line to view the character settings:

Copy codeThe Code is as follows:
Show variables like 'collation _ % ';
Show variables like 'character _ set _ % ';

If UTF-8-related strings are displayed, the modification is successful.

Restart the mysql service. Note that utf8 format is used when creating tables.

Mysql5.5 failed to start because the log file was deleted.

Edit my. cnf

Comment out the following two lines:

Copy codeThe Code is as follows:
Log-bin = mysql-bin
Binlog_format = mixed

Restart mysql. OK.

The above is a quick solution to Mysql5.5 installation and configuration and Chinese garbled characters introduced by xiaobian. I hope it will help you. If you have any questions, please leave a message for me, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.