An error occurred while installing Mysql,

Source: Internet
Author: User
Tags mysql command line

An error occurred while installing Mysql,

The driver was updated, causing a problem with the wireless Nic. However, even if the driver is downloaded from the official website, it cannot be done well, and it is particularly difficult. However, you have to reinstall the system. This is especially sad because there are too many things on the computer and various environmental variables. So it is recommended that you do not want to be proficient in computers. It is best to be confused (people like me) unless you want to study it.

The tragedy of reinstallation is that all software has to be reconfigured. A little reluctant, because after all, there is not much idle time. However, I am a little lucky because I have been learning other things and I have never studied the configuration at the beginning. I just feel very happy when I have the configuration, in this way, we can continue to do the next thing. After all, if the software is not ready or configured properly, you will not be able to learn the following. I just re-configured everything through this opportunity (in fact, to be honest, my heart is still a little broken ).

A problem occurs when installing mysql. In fact, the installation process will not cause too many problems. After the installation is complete, there will be no errors.

First error: the command window of mysql is opened and a crash occurs.

When an error occurs, the default configuration file for mysql under my mysql installation directory is my-default.ini. I installed a data packet in the form of mis, so mysql configuration is executed during the installation process. However, zip files must be decompressed and configured separately. When I first started learning mysql, I installed a zip file. I checked the information on the Internet and configured it for a whole day. As a result, the service program was not started, and the reason was not found. Later, I changed the mis format and installed it. Next we will talk about the problem of flashback. Because configuration is not required, I will directly open the mysql command line client and crash. Because the zip file format configuration is to change the my-default.ini TO my. ini, And the my-default.ini should be a reference for the configuration given. Then I changed the my-default.ini TO my. ini. Finally, the problem is solved. I think the reason may be that mysql is looking for this configuration file my. ini at startup. So even if you're a configuration-free version, you have to change the my-default.ini TO my. ini.

Second error: Open mysql command line client, prompt to enter the password, enter the password, and then crash.

The system reports an error: Access denied for user'' @ 'localhost' to database 'mysql'. The system returns the result only after the error is reported. If you want to see this error clearly, start your mysql service program first. Enter the doscommand window and go to the installation directory of your mysql \ bin. Enter the command and press Enter:

Copy codeThe Code is as follows:
Mysql-u root-p

Then you will be prompted to output the password Enterprise: 000000 (this is the password I set during installation ). Then the error "Access denied for user'' @ 'localhost' to database 'mysql' "appears. Access denied error. Either the password is incorrect or your permissions are insufficient.

Mysql comes with a database named mysql, which contains a user table and stored user information. You can query the information.

Copy codeThe Code is as follows:
Use mysql;
Show tables;

All tables in mysql are displayed. At the bottom, you can see a user table. Query all information in the user table

Copy codeThe Code is as follows:
Select * from user;

Too many query results will not be displayed. I have a total of 43 fields and 4 records. The User fields of the three records are root, and one is null. The Grant_priv fields of the three records are Y and the other is N. In fact, I don't know why these three users are there. I set one during the installation process, but I don't know what the other three users are. The user I set myself should be the fourth record, that is, the last record. Most field values of the other three users are Y. The value of the last user field is N. The last one should be the user I set during installation. Because Grant_priv is N, the access is denied. Solution:

Copy codeThe Code is as follows:
Update user set Grant_priv = 'y' where user = "value of your recorded username field" and host = "value of your recorded host ";
Flush privileges;

Now, my problem is solved. Because such an error has never occurred, I want to record it after solving it as a summary. What I have described is also very simple. If there is anything wrong with it, I hope you can correct it and communicate with each other.

Most common problems and solutions during mysql installation (Summary)

Recently, I have seen many webmasters asking questions about mysql installation on the Forum. Here I will briefly summarize the most common problems in mysql installation for your reference:

Background: OS: win7; mysql version: mysql 5.5 (64-bit)

1. Re-installing mysql stops at the last step.

Problem description: After mysql is installed for the first time, Chinese characters written using jdbc are garbled, but Chinese data already in the database is normal. The problem still cannot be solved after the character encoding is changed, so I decided to reinstall it. However, the reinstallation is stuck in the last step.

Solution: (1) Search for mysql in the Registry and delete related records; (2) Delete the mysql file under the mysql installation directory; (3) Delete the mysql folder under the C:/ProgramData directory. Then reinstall and install it successfully.

2. mysql-uroot-p cannot be logged on

Problem description: You can be sure that the password is correct, but it cannot be connected. Then, close the mysql service and start it with mysqld -- skip-grant-tables. The connection can be established normally. The reinstallation is the same many times. Previously, the root password was set during the installation process.

Solution: do not set the root password. After logging on to the console, run the command to change the root password and connect again. (Note: to support Chinese characters, select utf8 for character encoding during installation ).

3. After the installation is normal, Chinese data is garbled.

After the database is installed, import the data. Because the previous data adopts gbk encoding and utf8 encoding during mysql installation, the data found is garbled. Log on to mysql, run the set names gbk command, and query again. The Chinese character is displayed normally.

Articles you may be interested in:
  • Error 1045 during MySql Installation
  • Solution to 1044/1045 error when installing Navicat in Mysql
  • Error summary during mysql-5.5.28 source code Installation
  • Mysql ERROR 1577 ERROR Solution
  • CodeIgniter error mysql_connect (): No such file or directory solution
  • Mysql error 1366-Incorrect integer value solution
  • MySQL ERROR 2002 (HY000): Can't connect to local MySQL server through socket
  • MySQL ERROR 2013 (HY000) Solution
  • Mysql You can't specify target table for update in FROM clause error Solution

Related Article

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.