#author("2024-07-15T12:30:12+08:00","default:Admin","Admin") #author("2024-07-15T12:35:49+08:00","default:Admin","Admin") [[MySQL]] * 连接数据库 [#t79c1f55] mysql -u username -p * 创建数据库 [#y4a0cbc0] CREATE DATABASE 数据库名; * 创建用户 [#nc3a0da9] create user '用户名'@'主机名' identified by '密码'; * 用户权限 [#vf296285] #codeprettify{{ GRANT ALL PRIVILEGES ON 数据库名.* TO '账户名称'@'IP地址或%' IDENTIFIED BY '密码' grant all privileges on *.* to '用户名'@'localhost' identified by 'pwd'; flush privileges; }} * 修改表结构 [#r82b0e3f] #codeprettify{{ ALTER TABLE `ct_customer39217052000000401` ADD UNIQUE ( `login_id` ) }} * 运行sql文件 [#k916df49] "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe" -u root -p 数据库名 < "C:\inetpub\运行SQL文件名.sql" * 查看表命令 [#s7eb88f2] * 查看数据库里面所有表的命令 [#s7eb88f2] show tables; * 查看数据库使用端口的命令 [#wded5d4a] SHOW GLOBAL VARIABLES LIKE 'port'; #hr(); コメント: #comment_kcaptcha