mysql基础
Posted 橙子j
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql基础相关的知识,希望对你有一定的参考价值。
C:\\Users\\JChen46>mysql -u root -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is 6 Server version: 5.6.19 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type \'help;\' or \'\\h\' for help. Type \'\\c\' to clear the current input statement.
显示所有数据库:
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sakila | | test | | world | +--------------------+ 6 rows in set (0.02 sec)
切换到某个数据库:
mysql> use test; Database changed
查看test数据库下的所有表:
mysql> use test; Database changed
创建数据库:
mysql> create database guest character set utf8; Query OK, 1 row affected (0.33 sec)
增删改查:
https://www.cnblogs.com/Jasper-changing/p/11375720.html
如果mysql提示不是内部或外部命令,参考https://www.cnblogs.com/angry-apple/p/9007014.html
把mysql.exe的路径添加到环境变量path中
备份:
例如将创建的aaa库备份到文件back_aaa中
cd /home/data/mysql (进入到库目录)
mysqldump -u root -p –opt aaa > back_aaa
参考:https://www.cnblogs.com/kingle-study/p/10005483.html
mysqldump -h ip地址 -P 端口 -u 用户名 -p 密码 --databases 多个数据库名 > /root/tmp/文件名.sql
以上是关于mysql基础的主要内容,如果未能解决你的问题,请参考以下文章
[Go] 通过 17 个简短代码片段,切底弄懂 channel 基础
连接MySQL出现错误:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)(代码片段
使用 json rereiver php mysql 在片段中填充列表视图
关于mysql驱动版本报错解决,Cause: com.mysql.jdbc.exceptions.jdbc4Unknown system variable ‘query_cache_size(代码片段