Install MySQL manually on ubuntu12.04

Source: Internet
Author: User
Tags change settings mysql client dedicated server imx6

1, download the MySQL tar package from the network, I downloaded the version of 5.6, as follows: mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz

2, upload to Ubuntu, directly copy or use the tool can be, in my user imx under the download.

3, copy the mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz to/usr/local, use the command

#tar-XZVF mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz

4. Rename the extracted folder: sudo mv mysql-5.6.26-linux-glibc2.5-x86_64 MySQL

5. Modify MySQL owner and genus as MySQL user

#sudo chown-r mysql:mysql MySQL

6, install the dependent package, if not installed, otherwise in the installation of error

sudo apt-get install Libaio-dev

7. Execute MySQL Installation script

sudo scripts/mysql_install_db--user=mysql

8. Copy the MySQL configuration file to the ETC directory (global configuration)

Note: The default profile name for version 5.6 is changed by the original My-medium in order to My-default.

sudo cp support-files/my-default.cnf/etc/my.cnf

The parameters of MySQL are configured in this configuration file, if not modified, the default parameters are used.

9. Start MySQL

sudo bin/mysqld_safe--user=mysql &

This command is the daemon that initiates mysqld, which is mysqld

10. Configure MySQL client, MySQL client MySQL shell,

sudo cp support-files/mysql.server/etc/init.d/mysql.server

You can also modify MySQL,

11. Add the Mysql/bin/mysql command to the user command, or add the Mysql/bin directory to the path

To join the user command:

sudo ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql

Add Environment variables:

Export path= $PATH:/usr/local/mysql/bin

12. View MySQL Running status

sudo service mysql.server status
If it works, MySQL running will be displayed.

If not running is displayed, the service should not be started earlier, and can be started directly with service Mysql.server start

sudo service mysql.server [status|start|stop]

13. Let MySQL boot [defaults], cancel boot [remove]

sudo update-rc.d-f mysql.server defaults [remove]

14. Initialize the MySQL root user password

sudo bin/mysqladmin-u root password ' cipher text '

15. View the MySQL process:

#ps-a|grep MySQL
Show similar:
1829? 00:00:00 Mysqld_safe
1876? 00:00:31 mysqld
2. #kill-9 1829
3. #kill-9 1876

Ps-ef |grep MySQL

16. Allow root users to log in remotely

1> into Mysql:mysql–u root–p

2> Change database: use MySQL;

3> login from any host: Grant all privileges on * * to [email protected] '% ' identified by ' cipher text ' with GRANT option;

4> login from specified host: Grant all privileges on * * to [email protected] ' 192.168.1.101 ' identified by ' passw0rd ' with GRANT option;

5> authorization entry into force: flush privileges;

6> See if the host is added for% authorization: SELECT * from user;

7> View Database Character set: Show variables like ' character% ';

After we start MySQL, we can then test it and use the "MySQL" command to access the MySQL database console.
$mysql-U Root

Here the reason for using-u root is because I am now a general user (imx6), if you do not add-u root, MySQL will assume that it is imx6 log in. Note that I do not have access to root user mode here because it is not necessary. In general, the database in MySQL operation, there is no need to enter the root user mode, only in the setting of this possibility.

After entering MySQL, the most important thing is to set up the root user password in MySQL, otherwise, the MySQL service is not safe to say.
Mysql> GRANT All privileges on * * to [e-mail protected] identified by "123456";
If you need to use root for remote access from other machines, you can use
Mysql> GRANT All privileges on * * to [e-mail protected] "%" identified by "123456";
Note that I use 123456 as the root user's password, but the password is not secure, please use a combination of uppercase and lowercase letters and numbers, and not less than 8 bits.

Configuration file Reference:

[HTML]View PlainCopy 
    1. # for advice The change settings
    2. # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
    3. # * * * Don't EDIT this FILE. It ' s a template which'll be copied to the
    4. # * * * default location during install, and would be replaced if you
    5. # * * * * Upgrade to a newer version of MySQL.
    6. [Client]
    7. Port = 3306
    8. default-character-set=UTF8
    9. # Here's entries for some specific programs
    10. # The following values assume you has at least 32M RAM
    11. [Mysqld]
    12. character_set_server=UTF8
    13. lower_case_table_names=1
    14. init_connect=' SET NAMES UTF8 '
    15. lower_case_table_names=1
    16. max_connections=
    17. Max_allowed_packet = 32M
    18. Thread_cache_size =
    19. Thread_concurrency = 8
    20. Query_cache_size = 128M
    21. # Remove Leading # and set to the amount of RAM for the most important data
    22. # Cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%.
    23. # innodb_buffer_pool_size = 128M
    24. # Remove Leading # to turn on a very important data integrity option:logging
    25. # Changes to the binary log between backups.
    26. # Log_bin
    27. # These is commonly set, remove the # and set as required.
    28. # Basedir = ...
    29. # DataDir = ...
    30. # port = ... ..
    31. # server_id = ...
    32. # socket = ... ..
    33. # Remove Leading # To set options mainly useful for reporting servers.
    34. # The server defaults is faster for transactions and fast selects.
    35. # Adjust sizes as needed, experiment to find the optimal values.
    36. join_buffer_size = 16M
    37. sort_buffer_size = 16M
    38. # read_rnd_buffer_size = 2M
    39. Sql_mode=no_engine_substitution,strict_trans_tables
    40. [Mysqldump]
    41. Quick
    42. Quote-names
    43. Max_allowed_packet = 32M
    44. [MySQL]
    45. No-auto-rehash

Install MySQL manually on ubuntu12.04

Related Article

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.