90网 以什么方向发展方向呢?90all丶...

由TDAll90组成的实际电路图
由TDAll90组成的实际电路图
发布: | 作者:-- | 来源: -- | 查看:97次 | 用户关注:
本页面信息由华强电子网用户提供,如果涉嫌侵权,请与我们***联系,我们核实后将及时处理。
电路图分类
&&& 目前,处理器性能的主要衡量指标是时钟90all_土豆_高清视频在线观看为什么PCB走线通常以45度(或说是135度)改变走线方向?90度有什么弊端吗?_百度知道mac_MySQL*** - MySQL - 次元立方网 - 电脑知识与技术互动交流平台
mac_MySQL***
一、下载和***
到MySQL官网上/downloads/mysql/,下载Community Server版 约164M
出现如下界面,选择【No thanks,just start my download】
下载完的文件为:mysql-5.6.20-osx10.8-x86_64.dmg
1.点击,***包里的pkg文件,进行***
***后,会在根目录下的usr/local/生成一个MySQL的文件夹
***好后,再系统偏好设置的其他里,会出现如下图标:
3.点击此图标,跳出对话框
点击Start MySQL Server按钮,启动mysql
二、打开终端
在终端输入:
sudo chmod +w bashrc
sudo vi /etc/bashrc
在bashrc的末尾增加以下两个命令别名,便于快速使用mysql
mysql='/usr/local/mysql/bin/mysql'
mysqladmin='/usr/local/mysql/bin/mysqladmin'
提示:在bashrc中添加命令别名之后,需要重新启动终端,方可使用快捷命令。
三、设置mysql root帐号的密码
mysqladmin -u root password root
2.如果设置完密码后,需要修改,执行命令
mysqladmin -u root -p
password 最新密码
接着会提示输入密码,此时输入旧密码,回车
四、连接数据库
mysql -u root -p
然后提示输入密码,输入三中设置的初始密码
2.如果登陆远程主机上的mysql数据库
mysql -h 主机地址 -u 用户名 -p 用户密码
五. 配置PHPAdmin
1. 下载PHPAdmin,解压缩到~/Sites目录下,并将目录重命名为:phpmyadmin;
在中输入:
http://localhost/~apple/phpmyadmin/setup/
添加一个服务器配置即可。
六. 设置数据库默认字符集 (必须)
在终端输入:
-u root -p root
创建名为 mydb 的数据库
将 mydb 的默认字符集设置为 utf8
database mydb default character
注:mysql默认使用的字符集是latin1,不支持中文,需要设置一下哦。
五、执行常用的mysql数据库操作
首先,以root权限连接mysql
mysql -u root -proot
然后,输入root的密码
1、为新用户授权
格式如下:
grant 操作权限 on 数据库.* to 用户名@登陆主机地址 identified by '密码';
意思是:授予,某主机上的某用户(附带该用户的登陆密码)在某数据库上,执行某些操作的权限
(1)比如:任意主机上(&%&),用户(用户名:test1,密码:adc)在所有数据库上,执行任意操作的权限(很危险)
grant all privileges on *.* to test1@&%& identified by &abc&;
其中all privileges表示查询,插入,修改,删除的权限:select,insert,update,delete
以上命令等价于:
grant select,insert,update,delete on *.* to test1@&%& identified by &abc&;
(2)比如:授权本地主机上的用户操作数据库的权限
创建数据库(比如:openfire)
授予本地主机用户(用户名:test2,密码:123)访问数据库(数据库名称:openfire)的操作权限
grant all privileges on openfire.* to test2@localhost identified by &123&;
之后,就可以用新的用户,访问openfire数据库了
2.更新指定帐户的密码(用户名:test1,新密码:1234)
update mysql.user set password=password('1234') where User=&test1& and Host=&localhost&;
3.删除用户
先使用mysql数据库
删除mysql数据库中user表中的某个本地用户(test7)
delete from user where User=&test7& and Host=&localhost&;
4.显示命令
(1)显示所有数据库列表
初始化只有两个数据库,mysql和test
注意:MYSQL的系统信息都存储在mysql库中,比如:修改密码和新增用户,实际上就是用这个库进行操作
(2)打开某个数据库(比如数据库:openfire)
(3)显示本库中的所有表
(4)显示某表(table1)的结构
describe table1;
create database 库名;
use 库名;
create table 表名 (字段设定列表);
drop database 库名;
drop table 表名;
(9)将表中的记录清空
delete from 表名;
(10)显示表中的记录
select * from 表名;
六、退出mysql
七、启动、停止、重启MySQL
(bash命令下,密码是系统登录密码)
启动Mysql服务
sudo /Library/StartupItems/COM/COM start
停止Mysql服务
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
重启Mysql服务
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
八、其他常见表操作
bash下键入:mysql -uroot -p
回车后输入密码再回车
mysql -uroot -proot
临时更改窗口字符编码:输入、结果
set character_set_client=gb2312;
set character_set_results=gb2312;
=======================================================
使用指定utf8建库
mysql&create database mydb2 character set utf8;
mysql& create database mydb3 character set utf8 collate utf8_general_
Query OK, 1 row affected (0.03 sec)
+----------+----------------+--------------+---------------+
| Description
| Default collation
| Maxlen |
+----------+----------------+---------------------+--------+
| UTF-8 Unicode
| utf8_general_ci
mysql&show create database mydb2;
CREATE DATABASE `mydb2` /*!40100 DEFAULT CHARACTER SET utf8 */
mysql&create database mydb3 character set utf8 collate utf8_general_
&&alter database mydb2 character set gb2312;
&&show create database mydb2;
演示恢复和备份
create database mydb4;
use mydb4;
create table user
name varchar(20)
insert into user(name) values("beyond');
-----看到user表有数据
mysql管理员的用户名和密码:root
创建一个名称为mydb1的数据库
create database mydb1;
创建一个使用utf-8字符集的mydb2数据库。
create database mydb2 character set utf8;
创建一个使用utf-8字符集,并带校对规则的mydb3数据库。
create database mydb3 character set utf8 collate utf8_general_
查看前面创建的mydb2数据库的定义信息
show create database mydb2;
删除前面创建的mydb1数据库
drop database mydb1;
查看服务器中的数据库,并把其中某一个库的字符集修改为gb2312;
alter database mydb2 character set gb2312;
show create database mydb2;
演示恢复和备份
create database mydb4;
use mydb4;
create table user
name varchar(20)
insert into user(name) values('beyond');
-----看到user表有数据
对mydb4作备份操作,启动一个bash命令行窗口,执行如下命令
mysqldump -uroot -p tt&c:\tt.sql
1.先删除库
2.恢复tt库(1)
为恢复库,要先创建库
再恢复tt库
source c:\tt.sql
(source:可以执行一个 sql脚本)
3.恢复tt库(2)
为恢复库,要先创建库
mysql -uroot -proot tt&c:\1.
(window命令)
创建一个员工表
use mydb2;
create table employee
name varchar(40),
sex varchar(4),
birthday date,
entry_date date,
job varchar(40),
salary decimal(8,2),
resume text
查看库的所有表
查看表的创建细节
在上面员工表的基本上增加一个image列。
alter table emp
修改job列,使其长度为60。
alter table employee modify job varchar(60);
表名改为user。
修改表的字符集为utf-8
alter table user character set utf8;
列名name修改为username
alter table user change column name username varchar(40);
使用insert语句向表中插入三个员工的信息。
insert into employee(id,username,birthday,entry_date,job,salary,resume) values(1,'aaa','','','bbb',90,'aaaaa');
插入数据的细节1
insert into employee values(1,'aaa','','','bbb',90,'aaaaa');
插入数据的细节2
insert into employee values('1','aaa','','','bbb','90','aaaaa');
插入数据的细节3(插入中文)
要告诉mysql客户采用gb2312编码
show variables like 'chara%';
set character_set_client=gb2312;
insert into employee(id,username) values('3','张三');
要想查看时不乱码
show variables like 'chara%';
set character_set_results=gb2312;
将所有员工薪水修改为5000元。
update employee set salary=5000;
将姓名为’bbb’的员工薪水修改为3000元。
update employee set salary=3000 where username='bbb';
将姓名为’bbb的员工薪水修改为4000元,job改为ccc。
update employee set salary=4000,job='ccc' where username='bbb';
将bbb的薪水在原有基础上增加1000元。
update employee set salary=salary+1000 where username='bbb';
更新要注意的问题
update employee set username='ccc',salary=9000,birthday='',.....................
where id=1;
删除表中名称为’zs’的记录。
delete from employee where username='bbb';
删除表中所有记录。
使用truncate删除表中记录。
查询表中所有学生的信息。
查询表中所有学生的姓名和对应的英语成绩。
select name,
过滤表中重复的英语数据。
select distinct
在所有学生总分上加10分特长分。
select name,(chinese+english+math)+10
统计每个学生的总分。
select name,(chinese+english+math)
使用别名表示学生分数。
select name as 姓名,(chinese+english+math)+10 as 总分
select name 姓名,(chinese+english+math)+10
查询姓名为wu的学生成绩
select * from student where name='王五';
查询英语成绩大于90分的同学
select * from student where english&'90';
查询总分大于200分的所有同学
select name from student where (chinese+english+math)&200;
查询英语分数在 80-90之间的同学。
select name from student where english&80 and english&90;
select name from student where english between 80 and 90;
== select name from student where english&=80 and english&=90;
查询数学分数为89,90,91的同学。
select * from student where math in(89,90,91);
查询所有姓李的学生成绩。
select * from student where name like '李%';
select * from student where name like '李_';
查询数学分&80,语文分&80的同学。
select * from student where math&80 and chinese&80;
对数学成绩排序后输出。
select name,math from s
对总分排序后输出,然后再按从高到低的顺序输出
select name 姓名,(chinese+english+math) 总分 from student order by (chinese+english+math)
select name 姓名,(chinese+english+math) 总分 from student order by 总分
对姓李的学生成绩排序输出
select * from student where name like '李%' order by (chinese+english+math)
统计一个班级共有多少学生?
select count(name)
select count(*)
统计数学成绩大于90的学生有多少个?
select count(*) from student where math&80;
统计总分大于250的人数有多少?
select count(*) from student where (chinese+english+math)&250;
关于 count的函数的细节 (count只统有值的行)
统计一个班级数学总成绩?
select sum(math)
统计一个班级语文、英语、数学各科的总成绩
select sum(chinese),sum(english),sum(math)
统计一个班级语文、英语、数学的成绩总和
select sum(chinese+english+math)
统计一个班级语文成绩平均分
select sum(chinese)/count(*)
统计一个班级语文成绩平均分
select avg(chinese)
求一个班级总分平均分
select avg(chinese+math+english)
求班级最高分和最低分
select max(chinese+math+english),min(chinese+math+english)
对订单表中商品归类后,显示每一类商品的总价
select product,sum(price) from ord
查询购买了几类商品,并且每类总价大于100的商品
select product from orders group by product having sum(price)&100;
定义主键约束(每一个表必须有一个主键列)
create table student
primary key,
name varchar(40)
定义主键自动增长
create table student
primary key auto_increment,
name varchar(40)
定义唯一约束
create table student
id int primary key auto_increment,
name varchar(40) unique
定义非空约束
create table student
id int primary key auto_increment,
name varchar(40) unique not null
定义外键约束
create table husband
id int primary key,
name varchar(40)
create table wife
id int primary key,
name varchar(40),
husband_id int,
constraint husband_id_FK foreign key(husband_id) references husband(id)
一对多或多对一的对象存到数据库时,表的设计方案
部门和员工
create table department
id int primary key,
name varchar(40)
create table employee
id int primary key,
name varchar(40),
salary decimal(8,2),
department_id int,
constraint department_id_FK foreign key(department_id) references department(id)
多对多对象的表的设计(老师和学生)
create table teacher
id int primary key,
name varchar(40),
salary decimal(8,2)
create table student
id int primary key,
name varchar(40)
create table teacher_student
teacher_id int,
student_id int,
primary key(teacher_id,student_id),
constraint teacher_id_FK foreign key(teacher_id) references teacher(id),
constraint student_id_FK foreign key(student_id) references student(id)
一对一的对象的数据库设计
create table person
id int primary key,
name varchar(40)
create table idcard
id int primary key,
city varchar(40),
constraint id_FK foreign key(id) references person(id)
自连接的表
create table person
id int primary key,
name varchar(40),
parent_id int,
constraint parent_id_FK foreign key(parent_id) references person(id)
延伸阅读:
统计访问页面数量,以分辨率进行排名SELECTCONCAT(`h...
本教程为 李华明 编著的iOS-Cocos2d游戏开发系列教程:教程涵盖关于i......
专题主要学习DirectX的初级编程入门学习,对Directx11的入门及初学者有......
&面向对象的JavaScript&这一说法多少有些冗余,因为JavaScript 语言本......
Windows7系统专题 无论是升级操作系统、资料备份、加强资料的安全及管......

参考资料

 

随机推荐