sql,CREATE DATABASE my_database;,
`,接着创建用户并赋予权限:,
`sql,CREATE USER 'my_user'@'localhost' IDENTIFIED BY 'password';,GRANT ALL PRIVILEGES ON my_database.* TO 'my_user'@'localhost';,
`,使用以下命令连接到新创建的数据库:,
`sql,mysql -u my_user -p password my_database;,
``WHERE
子句来筛选满足特定条件的记录。SELECT * FROM table_name WHERE column_name = 'value';
用于查找列column_name
等于value
的所有行。sql,SHOW VARIABLES LIKE 'datadir'; -查看数据目录,SELECT table_schema, sum(data_length + index_length) / 1024 / 1024 AS 'MB' FROM information_schema.TABLES GROUP BY table_schema; -查看各数据库占用的存储空间(单位:MB),
``Powered By Z-BlogPHP 1.7.3