Wednesday, April 04, 2007

Linux下安装MySql

系统环境:Fedora Core 6 (2.6.20-1.2933.fc6)
软件要求:Mysql 5.0.37
Mysql下载地址:
http://mysql.isu.edu.tw/Downloads/MySQL-5.0/mysql-5.0.37-linux-i686-glibc23.tar.gz
此下载包为二进制版本的。
//更改下载的包的权限以进行解压,并将解压后的目录重命名复制到/usr/local/mysql
chmod 755 mysql-5.0.37-linux-i686-glibc23.tar.gz
tar xfz mysql-5.0.37-linux-i686-glibc23.tar.gz
cp -r mysql-5.0.37-linux-i686-glibc23 /usr/local/mysql

//建立mysql组及添加mysql用户到此组中
groupadd mysql
useradd mysql -g mysql

//设置mysql配置文件
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf

cd /usr/local/mysql
//初始化表并规定访问用户
./scripts/mysql_install_db --user=mysql

//设定mysql用户能够访问Mysql的数据库文件
chown -R mysql data

//运行Mysql
bin/mysqld_safe --user=mysql &

//修改root密码
bin/mysqladmin -u root password 新密码

//复制编译目录的一个脚本
cp support-files/mysql.server /etc/rc.d/init.d/mysqld

//设置使mysql每次启动都能自动运行
# chmod 700 /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on

//启动Mysql的命令为
service mysqld start

//简单访问Mysql的命令为
mysql -u root -p

在命令行下使用Mysql命令要在/usr/bin/下建立一个链接
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

4 comments:

ninest123 said...

chanel handbags, ugg boots, longchamp pas cher, louboutin pas cher, replica watches, longchamp, nike outlet, jordan shoes, louis vuitton outlet, ray ban sunglasses, sac longchamp, oakley sunglasses, prada handbags, nike free, air jordan pas cher, tiffany jewelry, polo ralph lauren outlet, tiffany and co, kate spade outlet, polo ralph lauren outlet, gucci outlet, nike air max, louis vuitton, louis vuitton, burberry, longchamp outlet, oakley sunglasses, nike roshe run, louboutin shoes, prada outlet, louboutin, ray ban sunglasses, louis vuitton, air max, louis vuitton outlet, louboutin outlet, longchamp outlet, christian louboutin outlet, michael kors, oakley sunglasses, ray ban sunglasses, uggs on sale, nike air max, replica watches, ralph lauren pas cher, tory burch outlet, cheap oakley sunglasses, ugg boots, oakley sunglasses, nike free

ninest123 said...

michael kors outlet, michael kors, replica handbags, michael kors, ralph lauren uk, burberry outlet online, ugg boots, nike free run uk, abercrombie and fitch, air force, north face, tn pas cher, nike air max, coach outlet, michael kors outlet, michael kors outlet, vans pas cher, michael kors, vanessa bruno, ugg boots, nike blazer, oakley pas cher, michael kors outlet, true religion jeans, hermes, nike roshe, nike air max, true religion jeans, converse pas cher, coach outlet, true religion outlet, lacoste pas cher, hogan, michael kors outlet, north face, coach purses, burberry, sac guess, hollister, true religion jeans, timberland, hollister pas cher, mulberry, michael kors, lululemon, kate spade handbags, nike air max, ray ban pas cher, new balance pas cher, ray ban uk

ninest123 said...

north face outlet, insanity workout, nike huarache, hollister, hollister, herve leger, nike air max, wedding dresses, soccer jerseys, chi flat iron, longchamp, birkin bag, p90x workout, louboutin, babyliss, iphone cases, mcm handbags, nike roshe, gucci, valentino shoes, asics running shoes, jimmy choo shoes, lancel, timberland boots, ghd, north face outlet, ferragamo shoes, nike air max, giuseppe zanotti, mac cosmetics, new balance, celine handbags, beats by dre, mont blanc, converse outlet, baseball bats, ralph lauren, bottega veneta, lululemon, hollister, soccer shoes, ray ban, vans, instyler, oakley, nike trainers, abercrombie and fitch, reebok shoes, nfl jerseys, vans shoes

ninest123 said...

karen millen, links of london, canada goose, ugg,ugg australia,ugg italia, sac louis vuitton pas cher, canada goose, louis vuitton, swarovski crystal, juicy couture outlet, ugg boots uk, moncler, moncler, thomas sabo, moncler, moncler outlet, moncler, canada goose uk, pandora charms, toms shoes, wedding dresses, juicy couture outlet, louis vuitton, coach outlet, moncler, supra shoes, montre pas cher, bottes ugg, marc jacobs, pandora charms, hollister, canada goose outlet, canada goose, moncler, swarovski, canada goose, moncler, ugg,uggs,uggs canada, canada goose outlet, ugg pas cher, pandora jewelry, replica watches, louis vuitton, louis vuitton, doudoune canada goose, pandora jewelry