Fedora下Mysql的简单使用
转到附录1(mysql 命令大全 - 命令详解
)
转到附录2(mysql乱码问题解决方法
)
在我的Fedora中,在系统安装时我就选择安装了Mysql了,所以就不用再去下载源代码,然后去慢慢编译。哈哈,偷了一个懒。
系统安装好了,Mysql时必不可少的,所以一定要检验一下Mysql可以用不。
首先切换到root账户,然后输入命令:service mysqld start
系统显示如下:
初始化 MySQL 数据库: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h stony password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script! [确定]
正在启动 mysqld: [确定]
看来Mysql的服务可以启动起来,应该问题不大了。
马上添加root密码,mysqladmin -u root password xxxxxx
登录以下,输入命令:mysql -u root -p
请求输入密码,输入密码,进入了!^_^
到这里,应该基本上可以说Mysql是没有问题的了。时间不早了,今天的Mysql就弄到这里。明天开始
相关文档:
以下的文章是MySQL grant语法的详细解析,如果你对MySQL grant语法的相关的实际操作有兴趣的话,你就可以对以下的文章点击观看了。我们大家都知道MySQL数据库赋予用户权限命令的简单格式可概括为:
grant 权限 on 数据库对象 to 用户
一、grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利。
grant ......
1. 给root加密码:/usr/bin/mysqladmin -u root password 123456
2. 导出:mysqldump -u root -p dbname > file.sql
3. 导入:mysql -u root -p dbname < backup-file.sql
4. 授权:grant all on *.* to root@"%" identified by "密码";
5. 收回权限:revoke all privileges on *.* from root@"%";
6. 登录:mys ......
关键词:MySQL 备份 恢复
备份是最简单的保护数据的方法,本节将介绍多种备份方法。为了得到一个一致的备份,在相关的表上做一个LOCK TABLES,你只需一个读锁定,当你在数据库目录中做文件的一个拷贝时,这允许其他线程继续查询该表;当你恢复数据时,需要一个写锁定,以避免冲突。
使用SQL ......