MySQL authorization and status query CREATEDATABASEodi; -- create an ODI database GRANTALLPRIVILEGESON *. * TOodi @
Create database odi for MySQL authorization and status query; -- CREATE an odi database grant all privileges on *. * TO odi @
MySQL authorization and status query
Create database odi; -- CREATE an ODI DATABASE
Grant all privileges on *. * TO odi @ '%' identified by 'odipasswd'; -- remote authorization;
Flush privileges; -- refresh the authorization table
Delete from user where user = "odi"; -- DELETE the USER authorization
Create database allen;
Grant all privileges on test. * TO odi @ '%' identified by 'odipasswd'; -- remote authorization
Grant all privileges on test TO odi @ '%' identified by 'odipasswd'; -- remote authorization
Grant all privileges on phplampDB. * TO phplamp @ localhost identified by '123 ';
-- Grant permission on database name. Table name user @ login host identified by "User Password ";
-- Grant permission on database name. Table name user @ login host identified by "User Password ";
-- Select host, user, password from user;
-- Update user set host = '%' where user = 'fang ';
Create database ccc;
Grant all privileges on ccc. * TO ccc @ '%' identified by 'cccpasswd'; -- remote authorization;
Flush privileges; -- refresh the authorization table
-- Create a user
Insert into mysql. user (HOST, USER, PASSWORD) VALUES ("%", "testdb", PASSWORD ("testpasswd "));
-- Create a new database
Create database testdb;
-- Authorize the test user to have all permissions for the testDB database (all permissions for a database)
Grant all privileges on testdb. * TO test @ localhost identified by 'testpasswd ';
-- Authorize the test user to have certain permissions on all databases
Grant select, DELETE, UPDATE, CREATE, drop on *. * TO test @ "%" identified by "1234 ";
-- Delete a user
Delete from user where user = 'test' and host = 'localhost ';
Flush privileges;
Drop database testDB; // delete a user's DATABASE
-- Delete an account and permissions:
Drop user username @ '% ';
Drop user username @ localhost;
-- Modify the password of a user
UPDATE mysql. user set password = PASSWORD ('new password') where user = "test" and host = "localhost ";
Flush privileges;
-- List all databases
Show databases;
-- Switch Database
USE database_name;
-- List all tables
Show tables;
-- Display table structure
DESCRIBE tables_name;
-- Delete a database
Drop database database_name;
-- Delete a data table
Drop table tables_name;
,