Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of mysql5.7.20 installation-free Edition

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you the "mysql5.7.20 installation-free version of the sample analysis", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn the "mysql5.7.20 installation-free version of the sample analysis" of this article.

1. download

Download your own mysql according to the version of your computer. I downloaded it as shown in the figure, and my installation process is based on this.

two。 After downloading, extract it to the custom path, and be sure not to have Chinese.

3. After decompressing, create a new file in the form of ini, named my.

The content of my is:

[mysql] # set mysql client default character set default-character-set=utf8 [mysqld] # set port 3306 port = 3306 # set mysql installation directory basedir=D:\ KQQ\ mysql-5.7.20-winx64 # set mysql database data storage directory datadir=D:\ KQQ\ mysql-5.7.20-winx64\ data # the character set used by the most Dalian connection max_connections=200 # server defaults to 8 bits Encoded latin1 character set character-set-server=utf8 # default storage engine default-storage-engine=INNODB to use when creating new tables

As shown in the figure:

4. Configure the environment variables to avoid going to the bin in the installation directory every time.

The configuration process is as follows:

-my computer right-click properties, advanced settings, environment variable configuration, edit the path variable, add the address of the bin directory, and other addresses before; separate. As shown in the figure:

5. After the configuration is complete, run cmd as an administrator with the following steps:

On disk C, find the cmd.exe under the System32 file under the Windows folder, and right-click to run as an administrator

* * 6. First change the directory to the bin directory of your mysql installation directory, then type mysqld in the cmd window

7.install can be run by pressing enter. Note: run cmd as an administrator. **

As shown in the figure:

8. Then enter mysqld-initialize-insecure-user=mysql

(after executing the above command, MySQL will build a data folder and default database. The user name is root by default and the password is empty by default.

9. Start the mysql service:

Enter net start mysql to start the service, OK is successful

Log in / log into the mysql database

Cmd window input: mysql-u root-p, enter, enter after the enter password appears, and then enter. As shown in the figure:

Because the user name and password were not set at the time of installation, the default login user name is root and the password is empty.

The-u command specifies the user name to use when connecting to the database.

-p command: used to specify the password entered by the user

Initialize password

When the root user logs in to mysql

Enter the following code step by step:

/ / use the database use mysql;// password as , customize update user set authentication_string=PASSWORD ("") where user= "root"; / / update permissions flush privileges; / / exit mysqlquit

Because the password has just been set. Reopen mysql.

At this point, the database password change is complete. Next, we will introduce the common database commands.

Create database new_dbname;-- New Database show databases;-- displays database use databasename;-- uses database select database ();-- View selected database show tables;-- displays all tables in the current library create table tablename (fieldname1 fieldtype1,fieldname2 fieldtype2,..) [ENGINE=engine_name];-- create table create table tablename select statement;-- create table desc tablename;-- view table structure show create table tablename through subquery -- View the table creation statement alter table tablename add new_fielname new_fieldtype;-- add column alter table tablename add new_fielname new_fieldtype after column name 1-after column name 1 add column alter table tablename modify fieldname new_fieldtype;-- modify column alter table tablename drop fieldname;-- delete column alter table tablename_old rename tablename_new;-- table rename insert into tablename (fieldname1,fieldname2,fieldnamen) valuse (value1,value2,valuen);-- add delete from tablename [where fieldname=value];-- delete update tablename set fieldname1=new_value where filename2=value -- change select * from tablename [where filename=value];-- check truncate table tablename;-- to clear all data in the table, and DDL statement show engines;-- to view the storage engine now provided by mysql: show variables like'% storage_engine%';-- view mysql's current default storage engine show create table tablename;-- to view the storage engine used for a table (the "ENGINE=" part of the result) alter table tablename ENGINE=InnoDB-- modification engine create table tablename (fieldname1 fieldtype1,fieldname2 fieldtype2,..) Set up the storage engine when ENGINE=engine_name;-- creates the table. These are all the contents of the article "sample Analysis of mysql5.7.20 installation-free Edition". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report