摘要:
关于登录linux时,/etc/profile、~/.bash_profile等几个文件的执行过程。 在登录Linux时要执行文件的过程如下: 在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile、 ~/.bash_login或 ~/.profile文件中的其中一个,执行的顺序为:~/.bash_profile、 ~/.bash_login、 ~/.profile。如果 ~/.bash_profile文件存在的话,一般还会执行 ~/.bashrc文件。因为在 ~/.bash_profile文件中一般会有下面的代码: if [ - 阅读全文
摘要:
1.alter操作表字段(1)增加字段 alter table 表名 add 字段名 字段类型; alter table student add name varchar(10);(2)修改字段 alter table 表名 change 旧字段名 新字段名 字段类型; alter table 表名 modify 字段名 字段类型;//修改字段类型 alter table student change name name varchar(20)not null default 'liming';//修改字段类型 default后边是 字段默认的值 alter table stu 阅读全文
摘要:
1.远程登录mysqlmysql -h ip -u root -p 密码2.创建用户 格式:grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码"; 例1:增加一个test1用户,密码为123456,可以在任何主机上登录,并对所有数据库有查询,增加,修改和删除的功能。需要在mysql的root用户下进行mysql>grant select,insert,update,delete on *.* to test1@"%" identified by "123456"; mysql>f 阅读全文
摘要:
查看mysql的存储引擎:mysql>show engines;查看默认的搜索引擎:mysql>show variables like '%storage_engine%';查看某个表用的什么引擎show create table 表名; 阅读全文
摘要:
创建数据库:create database td character set =utf8;use database td;//在数据库td中创建表create table tb_student (Student_ID int auto_increment primary key, Student_Name varchar(20), Sex char(1), Birthday varchar(10)) engine=innodb default character set =utf8 auto_increment =100;//指定存储引擎和字符集create table tb_subject 阅读全文