Loading...

Installing MySQL on Linux

MySQL (5.1)

To install MySQL on your Linux machine use the following commands:

# yum -y install mysql mysql-server

After installing the MySQL database you have to create a database schema for Analyze and secure the newly installed MySQL installation. It is also wise to add a separate user and password for the Analyze database.

To secure your installation, first start your database server.

# service mysqld start
Initializing MySQL database:  WARNING: The host 'testAgent.connectplaza.local' could not be looked up with resol     veip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
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 testAgent.connectplaza.local password 'new-password'

Alternatively you can run:
/usr/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 /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

If your database server has started correctly, you can secure your installation.

# mysql_secure_installation


NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: <type your password now>
Re-enter new password: <retype your password>
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
- Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
... Success!

Cleaning up...


All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Your database can now be accessed only via a localhost connection (or 127.0.0.1 as a binding address) via the root user.

Now create a database for Analyze, use the following commands to do so:

# mysql -u root -p
Enter password: <Enter your root password here>
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 10
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql> create database `analyzedb`;
Query OK, 1 row affected (0.00 sec)

mysql><CTRL>-D
mysql> Bye

Now it is time to create an user for the analayzedb database. This user will have full privileges because the actual tables are maintained via Hibernate.

# mysql_setpermission
# Password for user  to connect to MySQL: <Type root password here>
######################################################################
## Welcome to the permission setter 1.4 for MySQL.
## made by Luuk de Boer
######################################################################
What would you like to do:
  1. Set password for an existing user.
  2. Create a database + user privilege for that database
     and host combination (user can only do SELECT)
  3. Create/append user privilege for an existing database
     and host combination (user can only do SELECT)
  4. Create/append broader user privileges for an existing
     database and host combination
     (user can do SELECT,INSERT,UPDATE,DELETE)
  5. Create/append quite extended user privileges for an
     existing database and host combination (user can do
     SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,
     LOCK TABLES,CREATE TEMPORARY TABLES)
  6. Create/append full privileges for an existing database
     and host combination (user has FULL privilege)
  7. Remove all privileges for for an existing database and
     host combination.
     (user will have all permission fields set to N)
  0. exit this program

Make your choice [1,2,3,4,5,6,7,0]: 6


Which database from existing databases would you like to select:
You can choose from:
  - information_schema
  - analyzedb
  - mysql
Which database will it be (case sensitive). Type * for any: 
analyzedb
The database analyzedb will be used.

What username is to be created: <analyzy-user-name>
Username = <analyzy-user-name>
Would you like to set a password for <analyzy-user-name> [y/n]: y
What password do you want to specify for analyze: <analyze-user-password>
Type the password again: <analyze-user-password>
We now need to know from what host(s) the user will connect.
Keep in mind that % means 'from any host' ...
The host please: localhost
Would you like to add another host [yes/no]: yes
Okay, give us the host please: 127.0.0.1
Would you like to add another host [yes/no]: no

Okay we keep it with this ...
The following host(s) will be used: localhost,127.0.0.1.
######################################################################

That was it ... here is an overview of what you gave to me:
The database name       : analyzedb
The username            : analyze
The host(s)             : localhost,127.0.0.1
######################################################################

Are you pretty sure you would like to implement this [yes/no]: yes
Okay ... let's go then ...

Everything is inserted and mysql privileges have been reloaded.

######################################################################
## Welcome to the permission setter 1.4 for MySQL.
## made by Luuk de Boer
######################################################################
What would you like to do:
  1. Set password for an existing user.
  2. Create a database + user privilege for that database
     and host combination (user can only do SELECT)
  3. Create/append user privilege for an existing database
     and host combination (user can only do SELECT)
  4. Create/append broader user privileges for an existing
     database and host combination
     (user can do SELECT,INSERT,UPDATE,DELETE)
  5. Create/append quite extended user privileges for an
     existing database and host combination (user can do
     SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,
     LOCK TABLES,CREATE TEMPORARY TABLES)
  6. Create/append full privileges for an existing database
     and host combination (user has FULL privilege)
  7. Remove all privileges for for an existing database and
     host combination.
     (user will have all permission fields set to N)
  0. exit this program

Make your choice [1,2,3,4,5,6,7,0]: 0
We hope we can help you next time

# 

To start MySQL after a reboot we have to perform two commands, MySQL will be added to the auto start sequence of the Linux machine.

chkconfig --add mysqld 
chkconfig mysqld on

 


Copyright © 2018 ConnectPlaza.   For pricing, account management and more go to https://www.connectplaza.com

About Connectplaza

Si components version:   

Lorem ipsum delore set

Lorem ipsum delore set

Window size is not optimal. Please enlarge for optimal experience

No connection

No response from the server. This window will automaticly disappear by an valid connection