Home > Database > Mysql Tutorial > mysql installation-free configuration

mysql installation-free configuration

PHPz
Release: 2023-05-18 17:15:07
Original
723 people have browsed it

MySQL is a mature relational database management system that is often used for website development and data management. Normally, we need to install MySQL in our computer to use it. But today we will introduce a MySQL method that does not require installation-the installation-free version.

Installation-free version of MySQL

Installation-free version of MySQL means that we do not need to install the MySQL software on the computer, but directly use the command line tool to access the MySQL database. The advantage of this method that does not require installation is that you can easily use MySQL on different computers without having to install it on a new computer every time.

Download the installation-free version of MySQL

First, we need to download the installation-free version of MySQL. We can find the download page for the installation-free version of MySQL on the official MySQL website.

On this page, we can choose different versions and operating systems to download the installation-free version of MySQL that suits us.

In this article, we use the Windows operating system and downloaded the latest version of MySQL 8.0.23 installation-free version.

After the download is completed, unzip the compressed package and place the decompressed folder in the root directory of the C drive:

C:mysql-8.0.23-winx64
Copy after login

Configuring MySQL

Next, we Some configuration is required to use the installation-free version of MySQL.

Configuration configuration file

First, copy the my-default.ini file under the C:mysql-8.0.23-winx64 path copy and name it my.ini.

Then, find the following content in my.ini and modify it:

[mysqld]
#设置字符集
character_set_server=utf8mb4
[client]
default-character-set=utf8mb4
Copy after login

Here, we set the character set of MySQL to utf8mb4 , to support multiple languages.

Configure environment variables

Next, we need to add the path to MySQL in the environment variable. Open the computer's environment variable settings, find the Path variable, and add the path to MySQL:

C:mysql-8.0.23-winx64in
Copy after login

Initialize the database

Before we use the installation-free version of MySQL for the first time, An initialization operation is required, which creates the MySQL system database and related files. Execute the following command in the command line:

mysqld --initialize-insecure --user=mysql
Copy after login

At this time, the system database and related files will be created in the C:mysql-8.0.23-winx64data directory.

Start MySQL

After the initialization is completed, we can start the MySQL service. Execute the following command in the command line:

mysqld --console
Copy after login

At this time, the MySQL service will be started.

Using MySQL

After starting MySQL, we can use the MySQL client to access the database.

Execute the following command in the command line to log in to MySQL using the default super administrator account (user name is root, password is empty):

mysql -u root -p
Copy after login

This will ask you to enter your password, but because We did not set a super administrator password, so just press Enter.

Now that we have successfully logged in to the MySQL server, we can execute various SQL statements to manage and query the database.

Conclusion

This is how to use the installation-free version of MySQL. It is especially suitable for situations where MySQL needs to be used quickly on different computers. If you don't want to install MySQL on your computer or don't want to leave any traces on your computer, then MySQL Installation Free can provide a very good solution.

The above is the detailed content of mysql installation-free configuration. For more information, please follow other related articles on the PHP Chinese website!

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