在VMware下增加空间并将其挂载到相应目录

在初始化安装MYSQL时,报如下错误:
 [root@ora10g mysql]# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
ERROR: 3  Error writing file './mysql/db.frm' (Errcode: 28)
101209  4:52:38 [ERROR] Aborting

101209  4:52:38 [Note] ./bin/mysqld: Shutdown complete


Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

shell> ./bin/mysqld --skip-grant &

and use the command line tool ./bin/mysql
to connect to the mysql database and look at the grant tables:

shell> ./bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in /var/lib/mysql that may be helpful.

Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the ./bin/mysqlbug script!
去网上一查,发现原来是空间不够导致,去确认下:
[root@ora10g mysql]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             3.8G  3.8G     0 100% /
/dev/sda3             6.0G  4.4G  1.4G  77% /u01
/dev/sdb1             4.0G  3.4G  354M  91% /u02
tmpfs                 401M     0  401M   0% /dev/shm

果然,/usr对应的挂载点/空间已经全部耗尽。为了解决 这个问题,决定增加一块虚拟硬盘,然后划分好空间后将空间挂载到/usr目录下,下面是操作过程。
第一步:关闭虚拟机
1)确认Oracle测试库已经关闭ps -ef | grep ora_,如果没关闭,用shutdown immediate关闭数据库
2)跳转到root用户,使用shutdown -h now关闭主机
第二步:在虚拟机中增加一块6G的硬盘。这个步骤全图形化界面操作,这里不作详述
第三步:启动主机
第四步:确认并对新磁盘进行分区操作
fdisk /dev/sdc
使用n选项和w选项创建分区,并将分区信息写入MBR中
第五步:对分区进行格式化
shell>mkfs.ext3 /dev/sdc1
第六步:将新格式化的数据挂载到一个目录下
mount /dev/sdc1 /mnt/usr
第七步:将/usr目录下的所有文件复制到/mnt/usr下
shell>cp /usr/* /mnt/usr/
复制完后确认文件复制
第八步:rm掉/usr目录下的所有对象
shell>cd /usr
shell>rm -rf *
第九步:umount设备/dev/sdc1
shell>umount /dev/sdc1
第十步:将/dev/sdc1挂载到/usr目录下
mount /dev/sdc1 /usr
第十一步:修改文件/etc/fstab,添加如下内容:
/dev/sdc1               /usr                    ext3    defaults        3 1

第十二步:测试安装是否能成功完成
[root@ora10g usr]# cd /usr/local/mysql
[root@ora10g mysql]#  scripts/mysql_install_db --user=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:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h ora10g password 'new-password'

Alternatively you can run:
./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 . ; ./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 ./bin/mysqlbug script!

OK!

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/23084.html