FC7下mysql安装与启动
一:安装
无论你喜欢的是哪种LINUX套件,它都有可能带有MySQL。Slackware,Ret Hat,SusE和Debian中都在它们的当前版本中包含了它,这将提供一种最简单的方式来快速安装和运行MySQL。如果你的发行版本中没有提供MySQL软件包,或者你想得到最新的版本,你可以从MySQL的网站:www.mysql.com上下载二进制包或源代码包。
在Fedora 7的的桌面左上方,点击如下:
“应用程序“-->“添加/删除软件“,在弹出的对话软件更新安装列表首页中,选择“服务器“,然后选择右面的 MySQL进行安装即可。
在MySQL的安装过程中,安装脚本会为你自动创建一个初始数据库。同样,你也能得到一个用于启动和停止服务的init.d脚本(通常位于/etc/rc.d/init.d目录中)mysqld或mysql.
二:启动
安装后,可以以root身份使用/etc/rc.d/init.d/myqsld(或是mysql) start命令来启动服务器.也可以用 serviceconf命令启动图形化界面来启动mysql。
[root@localhost init.d]# /etc/rc.d/init.d/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 localhost password 'new-password'
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 mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
 
相关文档:
自从认识mysql的那天起就知道varchar的长度限制为255,不过现在这种情况已经改变了:
Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 65,535. The effective maximum length of a VARCHAR is subject to the maximum row size (65,535 by ......
格式为2008-06-16
查询出当天数据:
SELECT * from `table` WHERE date(时间字段) = curdate();
查询出当月字段:
SELECT *
from `table`
WHERE month( 时间字段) = month( now( ) ) ;
时间格式为1219876…… UNIX时间,只要应用“from_UNIXTIME( )”函数
例如查询当月:
SELECT ......
备份MySQL数据库的命令
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
备份MySQL数据库为带删除表的格式
备份MySQL数据库为带删除表的格式,能够让该备份覆盖已有数据库而不需要手动删除原有数据库。
mysqldump -–add-drop-table -uusername -ppassword databasename > bac ......
昨天,我突然想把一个数据库里的每个表,以及每个表的非空总纪录数存在另一个表里面。
首先,创建了一个存放数据的表:
create table tables
(
name varchar(50),
number int
);
insert into tables select table_name from information_schema.tables where table_shema = 'test';
但是不知道有没有方法,将非空的 ......
by ZaraByte
How to do a SQL Injection for MYSQL Server 5.0+
1. Find a vulnerable add a ‘ at the end of the site example: news.php?id=1 add a ‘ at the end of the 1 and see if you get a syntax error
2. order by #–
Keep upping the # until you get an error.
3. union all select 1 ......