Install mysql on centos and format hard disk _ MySQL

Source: Internet
Author: User
Install mysql on centos and format the hard disk CentOS

Uninstall mysql

1. view the installation package rpm-aq | grep mysql

2. start detaching

Yum remove Mysql *****

Uninstall one by one

Install mysql

1. copy the installation package to the machine.

2. rpm-ivh Mysql-server ***

3. rpm-ivh Mysql-client ***

4. start mysql service mysql start

5. log on to mysql-uroot-p

6. exit after the operation is successful.

7. stop service mysql stop

8. copy my. conf to/etc/my. conf.

9. change my. conf vi/etc/my. conf configures some parameters, including the storage location (the directory created by the storage location needs to be modified to the specified user group and the Directory modified by the user chown-R mysql: mysql)

10. format the hard disk when changing the storage location

11. run fdisk-l to view unformatted disks, such as/dev/xvdd.

12. format fdisk/dev/xvdd

13. Enter n p 1 at a time, press enter, and then w (save)

14. format the partition mkfs. ext3/dev/xvdd1

15. connect to/data after completion

16. set the storage location in my. conf

17. change the permission chown mysql: mysql * to start mysql.

18. confirm that the startup is successful.

19. run/usr/local/mysql/bin/mysql_install_db -- datadir =/opt/mysql/data -- user = mysql.

20. generally, after the modification, the service mysql start cannot be started./usr/bin/mysqld_safe &


Note:

1. configure chown-R mysql: Directory modified by mysql for jdk executable permissions

2. mount the hard disk to the/etc/fstab file/dev/xvdd1/mnt/nfs ext3 defaults 1 1

3. set environment variables

Export JAVA_HOME =/usr/java/jdk1.6.0 _ 29

Export PATH = $ PATH: $ JAVA_HOME/bin

4. modify jvm parameters and catalina. add JAVA_OPTS = "$ JAVA_OPTS-server-Xms20480M-Xmx20480M-Xmn7680M-Xss20480k-XX: PermSize = 229 M-XX: MaxPermSize = 1280 m-XX: + AggressiveOpts-XX: + UseParallelGC-XX: + UseBiasedLocking"

5. if nfs is used as the file server, you need to configure/etc/fstab and add the line IP address: /mnt/nfs/usr/java/apache-tomcat-6.0.35/webapps/ROOT/uploads nfs nodev, rw, rsize = 32768, wsize = 32768 0 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.