Install MySQL _ Start and Stop MySQL _ create a remote user under Solaris

Source: Internet
Author: User
It is easier to install MySQL in Solaris than to install Oracle. The following describes how to install MySQL in Solaris. Operating System: Number of solaris10.

It is easier to install MySQL in Solaris than to install Oracle. The following describes how to install MySQL in Solaris. Operating System: Number of solaris10.

It is easier to install MySQL on Solaris than to install Oracle. The following describes how to install MySQL on Solaris.

Operating System: Solaris10
Database: mysql5

Mysql-5.1.42-solaris10-i386.pkg.gz

1. Transfer media to the server

I use FTP to upload the media to the server.

Ii. Unpack

# Gzip-d/opt/databases/mysql-5.1.42-solaris10-i386.pkg.gz (/opt/databases/is where I store the Media)

3. Create Mysql users and groups

# Groupadd mysql

# Useradd-G mysql

4. Install using pkgadd

# Pkgadd-d/opt/database/mysql-5.1.42-solaris10-i386.pkg

(Follow the prompts to complete the installation process)

After installation, Mysql is installed in the/opt/mysql directory by default.

5. Create the my. cnf file in the/etc directory

# Vi my. cnf

[Mysqld]
Basedir =/opt/mysql
Datadir =/opt/mysql/data

6. Install the database

# Cd/opt/mysql

#./Scripts/mysql_install_db -- defaults-file =/etc/my. cnf -- user = mysql

7. start/stop MySQL

#/Etc/init. d/mysql start (start)

#/Etc/init. d/mysql stop (stop)

8. Modify the root user password

#/Opt/mysql/bin/mysqladmin-u root password 'new-password'

#/Opt/mysql/bin/mysqladmin-u root-h hostname password 'new-password'

9. Add a remote user for MySQL

Method 1:

Use root to log on to mysql (here root refers to the root user in mysql)

Mysql> grant all privileges on *. * TO admin @ localhost identified by 'something' with grant option;
Mysql> grant all privileges on *. * TO admin @ "%" identified by 'something' with grant option;

Method 2:

Mysql> insert into user VALUES ('localhost', 'admin', PASSWORD ('something'), 'y ', 'y', 'y ')
Mysql> insert into user VALUES ('%', 'admin', PASSWORD ('something'), 'y ', 'y', 'y ')

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.