随笔分类 - 数据库
摘要:Cast(字段名 as 转换的类型),其中类型可以为: BINARY[(N)]CHAR[(N)]DATEDATETIMEDECIMAL[(M[,D])]SIGNED [INTEGER]TIMEUNSIGNED [INTEGER] 用法: SELECT CAST(ctime AS char) as n
阅读全文
摘要:1. 检查是不是在某个终端里连接了数据库忘记关闭 2. 使用SQLite Browser打开了数据库忘记关闭? 3. 直接踢掉对数据库的连接 查看哪个进程在使用: sudo fuser -v motto.db USER PID ACCESS COMMAND motto.db: test 576925
阅读全文
摘要:select name, max(value) from out_pumptable group by name # 创建表 CREATE TABLE IF NOT EXISTS `runoob_tbl`( `runoob_id` INT UNSIGNED, `runoob_title` VARCH
阅读全文
摘要:1.Ctrl-Alt-T 打开终端 2.安装sqlite3sudo apt-get install sqlite3 libsqlite3-dev 3.创建数据库sqlite3 mysqlite.db 4.创建数据表CREATE TABLE myTable (id INTEGER, name VARC
阅读全文
摘要: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
阅读全文
摘要:sudo -u postgres psql ALTER USER postgres WITH PASSWORD 'postgres'; \q 忘记密码/重置密码: https://www.cnblogs.com/v5captain/p/14105368.html PostgreSQL 创建数据库 c
阅读全文
摘要:dropdb -h localhost -p 5432 -U postgres tipdm_DB
阅读全文
摘要:createdb -h localhost -p 5432 -U postgres tipdm_DB
阅读全文
摘要:select * from testtable1 limit 100;
阅读全文
摘要:ps aux |grep mysql 查找到进程编号,使用sudo kill ****关闭进程 ##启动MySQL服务sudo /usr/local/MySQL/support-files/mysql.server start ##停止MySQL服务sudo /usr/local/mysql/sup
阅读全文
摘要:select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='tableName'
阅读全文
摘要:MySQL5.7已经没有password这个字段了,改成了authentication_string update mysql.user set authentication_string=password('root') where user='root' ; 完整的更改MySQL密码的方式如下:
阅读全文
摘要:-- 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
阅读全文
摘要:MySQL 5.7 for Windows 解压缩版配置安装 http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html basedir =D:/Program Files (x86)/mysql-5.7.15 datadir =D:
阅读全文