易截截图软件、单文件、免安装、纯绿色、仅160KB

ubuntu 下mysql使用方法简介及mysql密码丢失的修复

ubuntu 下mysql使用方法简介
参考
http://hi.baidu.com/fancx/blog/item/4b91d82a5c66582bd42af1ca.html
http://hi.baidu.com/cnlen/blog/item/eb1251661646c820aa184c20.html
 
 
一、密码丢失的修复
l        停止MYSQL服务器:
$sudo /etc/init.d/mysql stop
收到打印信息
* Stopping MySQL database server mysqld                            [ OK ]
l        跳过授权表执行MYSQL服务器:
$sudo mysqld_safe --skip-grant-tables --skip-networking &
(注:参数--skip-grant-tables为跳过授权表;--skip-networking为不监听TCP/IP连接)
收到打印信息
[1] 8292 nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[8334]: started
l        执行MYSQL客户端:
$mysql
收到打印信息
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
mysql>
l        使用mysql数据库
mysql>use mysql;
收到打印信息
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
l        更新root密码
mysql>update user set password='' where user='root';
这里是加一个空密码给root;
收到打印信息
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0
l        退出mysql数据库
mysql> exit
收到打印信息
Bye
l        重新启动mysql服务器
$sudo /etc/init.d/mysql start
l        重新设置密码
$sudo /use/bin/mysqladmin -u root password 123456


相关文档:

mysql 分组汇总

 1.创建表:
    create table groupTable(dept varchar(6),phone varchar(20),amount int);
 2.插入测试数据:
    insert groupTable
    select '营业部',8001,20 union all
    select '营业部',8002,30 union all
    se ......

java 调用命令 备份mysql数据库

 代码如下:
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

ubuntu 下 MYSQL 安装

安装MySQL
sudo apt-get install mysql-server mysql-admin mysql-navigator mysql-query-browser
这个应该很简单了,而且我觉得大家在安装方面也没什么太大问题,所以也就不多说了,下面我们来讲讲配置。
配置MySQL
注意,在Ubuntu下MySQL缺省是只允许本地访问的,如果你要其他机器也能够访问的话,那么需要改变/etc/m ......

MySQL ALTER语法

 
ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]
alter_specification:
ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
or ADD INDEX [index_name] (index_col_name,...)
or ADD PRIMARY KEY (index_col_name,...)
or ADD UNIQUE [index_name] (index_col_name,...)
or ALTER [ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号