mysql command

    xiaoxiao2022-07-07  168

    1. 登录MYSQL:

    >mysql -u root -p

    >密码

    2. 查询用户:

    select * from mysql.user;

    主要三列: host, user, authentication_string

    3. 新建用户:

    create user 'test' identified by 'test';

    4. 查询数据库:

    show databases;

    5. 创建数据库:

    create database test;

    6. 给用户赋权限:

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

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

    flush privileges;

    7. 切换数据库:

    user 'test';

    8. 查询所有表:

                show tables;

    9. 查询表结构:

                 describe T_TEST_USER;

        

     

    最新回复(0)