Get the App
SLTechnology News&Howtos  ›  Database  › 

The basic Management method of MySQL

Shulou Source: shulou.com Published: 2022-05-31 18:49:48 09月17日 Update

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!

Tags: Method management password content user learning prompt practical deeper security information interest practicality practical simple operation more friends pattern space website Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Huawei Docker Shulou Tech Info