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

The basic Management method of MySQL

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

Share

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

This article mainly explains "the basic management methods of MySQL". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the basic management methods of MySQL.

1. Modify the password of root user

Prompt message: error: login failed, mysqladmin failed to change password

[root@mysql var] # mysqladmin-u root password 'roooot'

Mysqladmin: connect to server at 'localhost' failed

Error: 'Access denied for user' root'@'localhost' (using password: NO)'

Repair process:

# stop the service

Service mysqld stop

# safe mode startup

Mysqld_safe-- skip-grant-tables &

# Log in to mysql, regardless of password prompt

Mysql-u root-p

Use mysql

Update user set password=password ("root") where user='root' and host='localhost'

Flush privileges

Quit

# start mysql normally

Service mysqld restart

1. New users

# mysql-u root-p

Mysql > CREATE USER test IDENTIFIED BY 'test'

two。 New library

# mysql-u root-p

Create database test CHARACTER SET utf8 COLLATE utf8_general_ci

Create database test_gbk CHARACTER SET gbk COLLATE gbk_chinese_ci

Create database target CHARACTER SET utf8 COLLATE utf8_general_ci

Create database target_gbk CHARACTER SET gbk COLLATE gbk_chinese_ci

Create database benchmark CHARACTER SET gbk COLLATE gbk_chinese_ci

Create database source CHARACTER SET gbk COLLATE gbk_chinese_ci

Create database unittest CHARACTER SET gbk COLLATE gbk_chinese_ci

Mysql > grant all privileges on test.* to test@'%' identified by 'test'

Mysql > flush privileges

3. Resolve remote connection error

Mysql-u root-p mysqlmysql > use mysql;mysql > update user set host='% 'where user='root';mysql > flush privileges

4. Create a new tablespace

CREATE TABLESPACE 'tbs_data' ADD DATAFILE' tbs_data.ibd' ENGINE=INNODB

5. Set the table storage path

CREATE TABLE `Down TFs date AGGREGATION _ MYISAM` (

`strative_ id` VARCHAR (16) NOT NULL

`date_ id` VARCHAR (8) NOT NULL

`qua_ id` VARCHAR (4) NOT NULL

`fh` DECIMAL (16pr 6) DEFAULT NULL

`dl` DECIMAL (166pm 6) DEFAULT NULL

PRIMARY KEY (`strative_ id`, `date_ id`, `qua_ id`)

) ENGINE=MYISAM DATA DIRECTORY='/ data/mysql' INDEX DIRECTORY='/ data/mysql'

CREATE TABLE `DateTFFATADATAAAGREGATION` (

`strative_ id` VARCHAR (16) NOT NULL

`date_ id` VARCHAR (8) NOT NULL

`qua_ id` VARCHAR (4) NOT NULL

`fh` DECIMAL (16pr 6) DEFAULT NULL

`dl` DECIMAL (166pm 6) DEFAULT NULL

PRIMARY KEY (`strative_ id`, `date_ id`, `qua_ id`)

) ENGINE=INNODB DATA DIRECTORY ='/ data/mysql'

Show warnings

At this point, I believe you have a deeper understanding of the "basic management methods of MySQL". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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