mysql – 业余语言练习

alter table

alter table information add column English char(6); 1. 修改列的数据类型 假设你有一个表employees,其中有一个列salary,你想将其从DECIMAL(10, 2) 改为DECIMAL(15, 2)。

Published
Categorized as mysql

update table

update information set English=’89’ where no=0001;

Published
Categorized as mysql

insert into

MySQL [mydb]> insert into employee values -> (‘李天乐’,’93453′,’34’,’中科院信息技术研究所’); Query OK, 1 row affected (0.090 sec)

Published
Categorized as mysql

create database or table

MySQL [(none)]> create database mydb; Query OK, 1 row affected (0.093 sec) MySQL [(none)]> use mydb; Database changed MySQL [mydb]> create table employee; ERROR 1113 (42000): A table must have at least 1 column MySQL [mydb]> create table employee\ (name varchar(20) not null, number varchar(10),\ age char(5), department varchar(50)); Query OK, 0 rows affected (0.094… Continue reading create database or table

Published
Categorized as mysql

mysql 远程端口3307

vim /etc/my.cnf [client] #password = your_password port = 3307 socket = /tmp/mysql.sock systemctl restart rc-local.service vim frpc.ini [mysql] type = tcp local_ip = 10.168.1.115 local_port = 3306 remote_port = 3307 custom_domains = 39.100.102.12 systemctl restart frpc.service root135@root135:~/Desktop$ mysql -u root -p -h 39.100.102.12 -P 3307 Enter password: Welcome to the MariaDB monitor. Commands end with… Continue reading mysql 远程端口3307

Published
Categorized as mysql