随笔分类 -  数据库

摘要:Cast(字段名 as 转换的类型),其中类型可以为: BINARY[(N)]CHAR[(N)]DATEDATETIMEDECIMAL[(M[,D])]SIGNED [INTEGER]TIMEUNSIGNED [INTEGER] 用法: SELECT CAST(ctime AS char) as n 阅读全文
posted @ 2021-03-12 19:53 船长博客 阅读(1390) 评论(0) 推荐(1) 编辑
摘要:1. 检查是不是在某个终端里连接了数据库忘记关闭 2. 使用SQLite Browser打开了数据库忘记关闭? 3. 直接踢掉对数据库的连接 查看哪个进程在使用: sudo fuser -v motto.db USER PID ACCESS COMMAND motto.db: test 576925 阅读全文
posted @ 2021-01-27 20:43 船长博客 阅读(4115) 评论(0) 推荐(1) 编辑
摘要:select name, max(value) from out_pumptable group by name # 创建表 CREATE TABLE IF NOT EXISTS `runoob_tbl`( `runoob_id` INT UNSIGNED, `runoob_title` VARCH 阅读全文
posted @ 2021-01-26 20:14 船长博客 阅读(1367) 评论(0) 推荐(0) 编辑
摘要:1.Ctrl-Alt-T 打开终端 2.安装sqlite3sudo apt-get install sqlite3 libsqlite3-dev 3.创建数据库sqlite3 mysqlite.db 4.创建数据表CREATE TABLE myTable (id INTEGER, name VARC 阅读全文
posted @ 2020-12-25 20:02 船长博客 阅读(4802) 评论(0) 推荐(0) 编辑
摘要:1. find / -name pg_hba.conf2. sudo vi /etc/postgresql/13/main/pg_hba.conf 3. 拉到最下面,把postgres所在行的md5改成trust local all postgres md5 改后: 4. sudo service 阅读全文
posted @ 2020-12-08 20:06 船长博客 阅读(1201) 评论(0) 推荐(0) 编辑
摘要:sudo -u postgres psql ALTER USER postgres WITH PASSWORD 'postgres'; \q 忘记密码/重置密码: https://www.cnblogs.com/v5captain/p/14105368.html PostgreSQL 创建数据库 c 阅读全文
posted @ 2020-09-15 15:14 船长博客 阅读(2186) 评论(0) 推荐(0) 编辑
摘要:dropdb -h localhost -p 5432 -U postgres tipdm_DB 阅读全文
posted @ 2020-09-15 15:13 船长博客 阅读(270) 评论(0) 推荐(0) 编辑
摘要:createdb -h localhost -p 5432 -U postgres tipdm_DB 阅读全文
posted @ 2020-09-15 15:10 船长博客 阅读(723) 评论(0) 推荐(0) 编辑
摘要:select * from testtable1 limit 100; 阅读全文
posted @ 2020-07-07 20:21 船长博客 阅读(7347) 评论(0) 推荐(0) 编辑
摘要:ps aux |grep mysql 查找到进程编号,使用sudo kill ****关闭进程 ##启动MySQL服务sudo /usr/local/MySQL/support-files/mysql.server start ##停止MySQL服务sudo /usr/local/mysql/sup 阅读全文
posted @ 2020-05-02 10:50 船长博客 阅读(3037) 评论(1) 推荐(2) 编辑
摘要:select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='tableName' 阅读全文
posted @ 2020-04-23 14:55 船长博客 阅读(370) 评论(0) 推荐(0) 编辑
摘要:MySQL5.7已经没有password这个字段了,改成了authentication_string update mysql.user set authentication_string=password('root') where user='root' ; 完整的更改MySQL密码的方式如下: 阅读全文
posted @ 2020-04-02 21:20 船长博客 阅读(4067) 评论(0) 推荐(0) 编辑
摘要:-- MySQL 删除数据表 DROP TABLE test_db ; -- MySQL登陆 mysql -u root -p mysql -h 10.112.23.10 -u root -p -- 创建数据库 CREATE DATABASE test; SHOW DATABASES; DROP D 阅读全文
posted @ 2020-03-05 19:57 船长博客 阅读(464) 评论(0) 推荐(0) 编辑
摘要:MySQL 5.7 for Windows 解压缩版配置安装 http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html basedir =D:/Program Files (x86)/mysql-5.7.15 datadir =D: 阅读全文
posted @ 2016-10-12 09:23 船长博客 阅读(331) 评论(0) 推荐(0) 编辑

永远相信美好的事情即将发生!
点击右上角即可分享
微信分享提示