标签:一个 ike databases rem mariadb creat 界面 sql数据库 tab
1.进入mysql数据库
mysql -u root mysql
2.在mysql界面添加用户及权限
create user 'pyjsh'@'localhost' identified by 'pyjsh';
grant all on *.* to pyjsh@'%' identified by 'pyjsh';
grant all on *.* to pyjsh@'localhost' identified by 'pyjsh';
flush privileges;
show databases;
create database dbname;
drop database dbname;
MariaDB [dyf_da]> create table test_tb
-> (
-> id int(11) not null AUTO_INCREMENT primary key,
-> total int(11),
-> name varchar(256));
Query OK, 0 rows affected (0.021 sec)
desc test_tb;
show columns from test_tb; 和上条命令查询结果一致
alter table test_tb add column age varchar(256);
alter table test_tb modify age int(11);
insert into test_tb(total,name,age) values(34,'tina',23);
update test_tb set total=15,name='andy',age=22 where id=1;
select count(*) from test_tb;
select * from test_tb where name like '%and%';
alter table test_tb rename to tb01;
delete from tb01 where id=2;
truncate table tb01;
create table tb2 select * from tb01;
drop table tb01;
drop database dyf_da;
标签:一个 ike databases rem mariadb creat 界面 sql数据库 tab
原文地址:https://www.cnblogs.com/dyfblogs/p/11386255.html