In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the configuration method of mysql5.5". In the daily operation, I believe that many people have doubts about the configuration method of mysql5.5. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "configuration method of mysql5.5". Next, please follow the editor to study!
The first step: open the root directory, open my-huge.ini (other my-*.ini files can also be), make some changes (specific modification method not to say, online search "mysql installation-free version configuration" is all), and then save as my.ini, as for the location of this file, some say that in C:\ Windows, some say that in the root directory of mysql, because this has nothing to do with this article, no longer entangled with this.
Step 2: run the DOS window as an administrator, change the directory to the bin folder of the mysql installation directory (if you don't want to change the directory all the time, you can add the bin folder to the path environment variable, so you can run the command under the bin folder directly from the open command prompt), run mysqld-install, so that the MySQL service is loaded into the windows service and is "automatic", and then run net start MySQL You can start the service, and then the configuration is successful.
The online method is generally the above method, slightly different, I have tried, but when starting the MySQL service, there is always a start failure, error 1067, the process ends this kind of error unexpectedly, uninstall the service over and over again, install the service, modify my.ini, but none of it works. Later, when I saw a way to execute the command: mysql-u root shutdown can be solved, I tried, but an error popped up. Let me see whether the process mysqld.exe was running. When I opened the task manager and found that there was no such process, I went to the bin folder and double-clicked mysqld.exe. Double-click several times but never started. At this time, I was a little impatient, but I was still patient. Restore the system to its original state: uninstall the service (command: mysqld
-remove, also if the DOS window is running as an administrator, delete the my.ini. At this time, reload the service: mysqld-install, after the system prompts you to load successfully, run net start MySQL again, and unexpectedly find that the startup is successful! It was all caused by this my.ini, but I still don't know what this is for. In short, the problem is solved. Maybe the current version does not need this file.
Originally thought that this version does not need to configure the my.ini file, but later encountered the problem of Chinese garbled in the process of use. Although the problem of garbled code can be solved by set names gbk, the solution is temporary. When the server restarts, the coding problem reappears, and it has to be manually configured again, which is especially troublesome. The best solution is to configure it in the my.ini file. Every time the MySQL service starts, always look up the my.ini file, read the default parameters defined in it, and use the default parameters if you do not change them manually during the use of the database.
The contents of the my.ini file in version 5.5 of mysql (which is different from version 5.1) are described below.
Create a new my.ini file in the mysql root directory and open it with a reader (I use UltraEdit, it is recommended not to edit it in notepad and change the suffix from .txt to .ini, because according to the mysql official document, this file is required to be a plain text file, and random change of the suffix name can easily cause unpredictable errors), add the following:
[mysqld]
Character-set-server=gbk
# The TCP/IP Port the MySQL Server will listen on
Port=3306
# set basedir to your installation path
Basedir=D:/Mysql
# set datadir to the location of your data directory
Datadir=D:/Mysql/data
[mysql]
Default-character-set=gbk
Pay attention to two points here:
1. Write the directory using the symbol "/" instead of "\". If you want to use "\", you need to replace it with "\". For example, basedir=D:\\ Mysql. This is the root directory of your mysql installation.
2. As mentioned earlier, once you join the my.ini file, the MySQL service will not be opened, resulting in a 1067 error, which is rooted in the setting of default-character-set. In version 5. 5, this can be written in [mysql], while in [mysqld] it needs to be changed to: character-set-server=gbk.
After saving, if the MySQL service has been installed, execute mysqld-- remove uninstall service, then execute mysqld-- install MySQL-- defaults-file=D:/Mysql/my.ini (note the number of spaces and hyphens), the service can be loaded, and then execute net start mysql under administrator permission to open the MySQL service, and execute net stop mysql to stop the service. Note that when loading the service, the command line directory should be changed to the bin folder of the mysql installation directory, because the system will write the path of mysqld to the registry.
If you add an environment variable to the bin folder in the mysql directory and start the MySQL service, execute the mysql-u root command (if you don't have a password) to enter the DOS operation window of mysql.
At this point, the study on the "configuration method of mysql5.5" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.