zoukankan
html css js c++ java
mysql backup
Mysql 备份
Mysql 存储位置为 /var/lib/mysql/
第一步将所需的数据库copy出来
第二步执行备份命令
Mysqldump -u 用户名 -p 目标数据库名 > 数据库命名.sql
Mysql 还原
Mysql 常用的一些命令
附后一些常用的命令
(4) 制定TestDB数据库为当前默认数据库
mysql> use TestDB;
(5) 在TestDB数据库中创建表customers
mysql> create table customers(userid int not null, username varchar(20) not null);
(6) 显示数据库列表
mysql> show databases;
(7)显示数据库中的表
mysql> show tables;
(8)删除表customers
mysql> drop table customers;
(9)显示customers表的结构
mysql> desc customers;
(10) 向customers表中插入一条记录
mysql> insert into customers(userid, username) values(1, 'hujiahui');
(11) 让操作及时生效;
mysql> commit;
(12) 查询customers中的记录
mysql>
select
* from customers;
(12) 更新表中的数据
mysql> update customers set username='DennisHu' where userid=1;
(13) 删除表中的记录
mysql> delete from customers;
(14)授予hjh用户访问数据库的权限
# grant select, insert, update, delete on
.
to hjh@localhost indentified by "123456";
备注:hjh是
Linux
用户名,123456是访问mysql的密码
(15)采用用户名和密码登录mysql
# mysql -uhjh -p123456
查看全文
相关阅读:
[LeetCode] Course Schedule
[Algorithms] Topological Sort
[Algorithms] Graph Traversal (BFS and DFS)
[LeetCode] One Edit Distance
[LeetCode] Summary Ranges
[LeetCode] Missing Ranges
[LeetCode] Fraction to Recurring Decimal
17.Docker之使用dockerfile创建jdk镜像
16.Docker之使用dockerfile创建nginx镜像
7.Docker之dockerfile指令简介
原文地址:https://www.cnblogs.com/qjtjh/p/8269145.html
最新文章
lintcode :最长单词
lintcode :最长上升连续子序列
lintcode :最小路径和
lintcode:Minimum Subarray 最小子数组
lintcode:Length of Last Word 最后一个单词的长度
lintcode :旋转字符串
lintcode:Fibonacci 斐波纳契数列
lintcode :数组剔除元素后的乘积
lintcode:数字三角形
lintcode:Search Insert Position 搜索插入位置
热门文章
lintcode:搜索二维矩阵II
lintcode :搜索二维矩阵
[LintCode] 有效回文串
[LintCode] 有效的括号序列
[LintCode] 翻转二叉树
[LintCode] 带最小值操作的栈
[LintCode] 用栈实现队列
[LintCode] 最长公共子序列
[LintCode] 最长公共子串
[LeetCode] Course Schedule II
Copyright © 2011-2022 走看看