参考链接:
cmd连接mysql
- mysql -u root -p
C:\Users\ASU>mysql -u root -p
Enter password: ***
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.17 MySQL Community Server - GPL
Copyright (c) 2000, 2019, 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>
从txt文本导入到数据库中
1、首先打开Navicat软件,连接到数据库进入需要导入的数据库:
2、然后点击表格,选择右键导入向导,进行导入操作:
3、这里可以选择很多种导入方式,点击文本文件从txt中导入,选择后点击下一步:
4、点击下一步会弹出对话框,选择要导入的文件,双击文件导入即可:
5、导入之后进入下一步,然后设置分隔符,这里不做改变,然后回车进行下一步:
6、然后需要拿表中的元素和txt中的元素的首行做匹配,这里需要一个一个完成:
7、完成手工匹配后点才会开始导入操作,如果有错误信息会在下方显示,没有则会通过:
8、导入时间根据数据量的大小决定,等待片刻就会打入成功,最后打开数据会发现数据已经全部导入了:
IDEA 的datasource连接mysql数据库出错
- set global time_zone = ‘+8:00’;
mysql> show variables like'%time_zone';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | |
| time_zone | SYSTEM |
+------------------+--------+
2 rows in set, 1 warning (0.03 sec)
mysql> set global time_zone = '+8:00';
Query OK, 0 rows affected (0.01 sec)
语法
limit num1<,num2>
- num1:偏移量offset
- num2:显示的记录数
- 查找范围(num1, num1+num2]