MySQL detailed installation and troubleshooting

Source: Internet
Author: User
Tags openssl import database

#=====================

Import Database:


# TAR-XVF employees_db-full-1.0.6.tar.bz2

# CD employees_db
# msyql-h Localhost-u Root < Employees.sql
=============================================



Precautions:

1, [ ]# rpm-qa|grep MySQL

If both Mysql-libs and Mysql-server are present, unload both.

2, []# whereis cmake

3. []# CD mysql-5.6.21

[]# Vim Install-source

Error occurred:

Troubleshooting:

[]# yum Install ncurses* error still occurs. As follows:

Error Downloading Packages:
ncurses-static-5.7-3.20090208.el6.x86_64:failure:packages/ncurses-static-5.7-3.20090208

. el6.x86_64.rpm from Local-yum: [Errno) No more mirrors to try.

continue troubleshooting-Yum Install ncurses Ncurses-devel --Installation is successful.

[] #rm-rf cmakefiles CMakeCache.txt

4, []# yum list|grep Bison---Yum install bison* error unexpectedly found:

#yum List|grep Bison m there.

Let's use the Internet yum source.


=============


650) this.width=650; "src=" Http://note.youdao.com/yws/res/19319/F559B62F799B4CB39F2A1DB406D1B4EC "alt=" Cmake-2.8.11.2.tar.gz "title=" cmake-2.8.11.2.tar.gz "id=" userfile_d165d46b9 "/>

=============

How do I set a password for MySQL?

Mysql>set password=?

Mysql>flush privileges;

==============


# yum-y Install ncurses ncurses-devel gcc gcc-c++ OpenSSL openssl-devel libtool*

One, MySQL installation and basic configuration

1, installation CMake

# TAR-VXF Cmake-2.8.11.2.tar.gz

# CD cmake-2.8.11.2

#./configure
# Make && make install

2. Install MySQL

# TAR-VXF Mysql-5.6.21.tar.gz

# CD mysql-5.6.21


# cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/database/mydata-dsysconfdir=/etc-dtmpdir=/tmp- Dwith_innobase_storage_engine=1-dwith_archive_storage_engine=1-dwith_blackhole_storage_engine=1-dwith_ Perfschema_storage_engine=1-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-denabled_local_infile=1- Dmysql_unix_addr=/tmp/mysql.sock-dwith_extra_charsets=all

(Note that there are spaces!) )


# make && make install #./configure--help  


# groupadd-g MySQL
# useradd-g mysql-u mysql-m-s/sbin/nologin
# man Useradd
# Ls/home
# CD/
# CD -and LS
# chown Mysql:mysql mydata-r
# Cd/usr/local/mysql/support-files
# ls
# CP Mysql.server/etc/init.d/mysqld
# CP MY-DEFAULT.CNF/ETC/MY.CNF ---Y(My-default.cnf is a template, cat a bit)


# vim/etc/my.cnf
[Client]
Port = 3306
socket =/tmp/mysql.sock

[Mysqld]
user = MySQL
innodb_buffer_pool_size = 128M
Log_bin = Master-log
Basedir =/usr/local/mysql
DataDir =/database/mydata
Port = 3306
server_id = 1
socket =/tmp/mysql.sock
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M

character_set_server = UTF8
Explicit_defaults_for_timestamp = on
Sql_mode=no_engine_substitution,strict_trans_tables

# Cd/usr/local/mysql

#./scripts/mysql_install_db--user=mysql--datadir=/database/mydata--explicit_defaults _for_timestamp=1

An error occurred in the above execution script:

Troubleshooting:

=====

#chmod +x scripts/mysql_install_db

# mkdir/database/mydata-p

======


# service Mysqld re Start


3. Connect to the database
# mysql-s/tmp/mysql.sock \ \ Use socket to connect to MySQL

# mysql-s/tmp/mysql.sock-p aixocm \ password is aixocm ?????

# mysql-u root-h localhost

An error occurred while connecting to the database: -bash:mysql:command not found

Because the path to the MySQL command is below/usr/local/mysql/bin, and you use the MySQL command directly,
system This command is not found under/usr/bin, which is checked under this command.

The solution is:

Ln-s/usr/local/mysql/bin/mysql/usr/bin make a link

or: Cp/usr/lo Cal/mysql/bin/mysql/usr/bin




# mysql-ugongda-p123456-h 10.0.0.60

remote to 10.0.0.60 log in to MySQL with a user password of 123456


This article is from the "Zhanglulu" blog, make sure to keep this source http://zhanglulu913.blog.51cto.com/10592685/1681906

MySQL detailed installation and troubleshooting

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.