在mysql数据库中修改root的密码
下面我给大家介绍几种在mysql数据库中修改root密码的方法
方法一:
原始密码是 ckh
mysql -uroot -pckh
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 5.0.22-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql
Database changed
mysql> update user set password=password('newpass') where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
方法二:
原始密码是 newpass , 新密码是 mysql
mysqladmin -uroot -pnewpass password mysql
方法三
原始密码是 mysql , 新密码是 ckh
mysql -uroot -pmysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19 to server version: 5.0.22-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> set password for root@'localhost'=password('ckh');
Query OK, 0 rows affected (0.00 sec)
mysql>
下面列出一些常用的mysql数据库管理命令:
安装 利用RPM包安装Mysql
设置TCP 3306端口的iptables
root密码管理 设置root用户的密码 mysqladmin -uroot password 'password'
修改root用户的密码 mysqladmin -uroot -p password 'password'
数据库,表管理 进入mysql mysql -h hostname -uroot -p
创建数据库 mysql> create database location
导入数据结构 mysql -uroot -p
相关文档:
今天使用PowerDesigner搭建了一个小项目,最后执行完SQL脚本时才发现有2张表的表名中间多了一个空格,查完资料,最后并惊奇发现映射文件竟然多了2个`,就是shift+数字键1的那个,也就是他在脚本是这样写的:
create table `table1`(....);
问题解决。
PS:从网上找到的资料:
作为一个Oracle DBA,MySQL很多SQL语法与Orac ......
安装配置mysql
http://edu.codepub.com/2009/1213/18710.php
一、
下载编译安装
#cd /usr/local/src/
#wget http://mysql.byungsoo.net/Downloads/MySQL-5.1/mysql-5.1.38.tar.gz
#tar –xzvf mysql-5.1.38.tar.gz ../software/
#./configure
--prefix=/usr/local/mysql //MySQL安装目录
--datadir=/mydata / ......
mysql alter 语句用法,添加、修改、删除字段等
//主键549830479
alter table tabelname add new_fiel ......
MYSQL和ORACLE的一些操作区别
有很多应用项目, 刚起步的时候用MYSQL数据库基本上能实现各种功能需求,随着应用用户的增多,数据量的增加,MYSQL渐渐地出现不堪重负的情况:连接很慢甚至宕机,于是就有把数据从MYSQL迁到ORACLE的需求,应用程序也要相应做一些修改。本人总结出以下几点注意事项,希望对大家有所帮助。
1.自 ......