名字
/etc/init.d/mysqld start
/etc/init.d/mysqld stop
/etc/init.d/mysqld status
mysqladmin -uroot password "123"
或用mysql client连上去,然后执行
# 连上mysql
> mysql -u root
# 执行命令
SET PASSWORD = PASSWORD('123');
grant all privileges on *.* to 'root'@'%' identified by '123' with GRANT OPTION;
flush privileges;
没有密码时
mysql -u root
有密码时
mysql -u root -p123
# 原密码是123,修改成123456
mysqladmin -u root -p123 password 123456
# 原密码是123,修改成不要密码
mysqladmin -u root -p123 password ""
//如果存在数据库tio_site_mg则删除
drop database if exists tio_site_mg;
//创建数据库tio_site_mg,并指定字符集
create database tio_site_mg default character set utf8mb4 collate utf8mb4_unicode_ci;
// 切换到数据库
use tio_site_mg;
//创建mg_menu表
DROP TABLE IF EXISTS `mg_menu`;
CREATE TABLE `mg_menu` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`upid` int(8) DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8 NOT NULL,
`url` varchar(255) CHARACTER SET utf8 NOT NULL,
`layer` int(8) NOT NULL,
`type` int(2) DEFAULT NULL COMMENT '菜单类型',
`status` tinyint(2) DEFAULT 1 COMMENT '状态1有效 0无效',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=60381 DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=DYNAMIC;
INSERT INTO `mg_menu` VALUES ('1', 'null', '后台管理系统', '', '0', '1', '1');
mysqldump --opt --single-transaction=TRUE --user=root --password=123 --host=127.0.0.1 --protocol=tcp --port=3306 --default-character-set=utf8 --routines --events tio_site_conf > .\tio_site_conf.sql
mysqldump --host=127.0.0.1 --protocol=tcp --port=3306 -uroot -p123456 dbname table1 table2 > table12.sql
mysql -u root -p123 --default-character-set=utf8
drop database if exists tio_site_conf;
create database tio_site_conf default character set utf8mb4 collate utf8mb4_unicode_ci;
use tio_site_conf;
source tio_site_conf.sql;
mysql -u root -p123 --default-character-set=utf8
use tio_site_main;
source blog.sql;
ALTER TABLE `blog`
ADD COLUMN `topit` int(11) NULL DEFAULT 999 COMMENT '置顶,值越小越在前面' AFTER `recommend`;
ALTER TABLE `blog`
MODIFY COLUMN `top` int(11) NOT NULL DEFAULT 99999999 COMMENT '置顶,值越小越在前面' AFTER `recommend`;
ALTER TABLE `blog`
MODIFY COLUMN `top` int(11) NOT NULL DEFAULT 99999999 COMMENT '置顶,值越小越在前面' AFTER `recommend`;
alter table blog drop column top, drop column createtime;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;
FLUSH PRIVILEGES;
最新评论 我的评论
t-io为本站提供HTTP、WebSocket、Socket、页面渲染与压缩等服务,nginx为本站提供反向代理服务
© 2017-2023 钛特云 版权所有 | 浙ICP备17032976号 | 浙公网安备 33011802002129号