[1]

没有/etc/my.cnf;

rpm包安装的MySQL是不会安装/etc/my.cnf文件的;处理:cp /usr/share/mysql/my-huge.cnf /etc/my.cnf

[2]

设置密码;

/usr/bin/mysqladmin -u root  password   新密码

重新登录验证

mysql -u root –p   新密码

mysql -u root -p   直接回车

# /usr/bin/mysql
mysql mysqld_safe mysql_setpermission
mysqlaccess mysqldump mysqlshow
mysqladmin mysqldumpslow mysqlslap
mysqlbinlog mysql_embedded mysqltest
mysqlbug mysql_find_rows mysqltest_embedded
mysqlcheck mysql_fix_extensions mysql_tzinfo_to_sql
mysql_client_test mysqlhotcopy mysql_upgrade
mysql_client_test_embedded mysqlimport mysql_waitpid
mysql_config mysql_install_db mysql_zap
mysql_convert_table_format mysql_plugin
mysqld_multi mysql_secure_installation

[3]

创建一库,创建一用户,授权该用户拥有该库的全权;

mysql>create database xxxDB;

mysql>create user xxx identified by '333';
mysql>grant all privileges on xxxDB.* to xxx;

mysql>flush  privileges;

mysql>use xxxDB;

mysql> source /home/username/test.sql;

[4]

[w@wb ~]$ mysql -h 远程数据库主机IP -u 用户名 -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28
Server version: 5.5.34 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, 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> use test;
Database changed
mysql>  show tables;

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

mysql编译安装在centos6.5上;

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

# cd /opt/data/src/about_MySQL
# pwd
/opt/data/src/about_MySQL
# ll
total 301656
-rw-rw-r--. 1 tomcat tomcat 124769996 Aug 7 16:54 mysql-5.1.48-linux-x86_64-icc-glibc23.tar.gz
-rw-rw-r--. 1 tomcat tomcat 184122460 Aug 7 17:45 mysql-5.5.35-linux2.6-x86_64.tar.gz
# yum -y install ntp vim-enhanced gcc gcc-c++ flex bison autoconf automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel libXpm-devel gettext-devel pam-devel libtool libtool-ltdl openssl openssl-devel fontconfig-devel libxml2-devel curl-devel libicu libicu-devel libmcrypt libmcrypt-devel libmhash libmhash-devel
# wget https://distfiles.macports.org/cmake/cmake-2.8.12.tar.gz
# tar -xvzf cmake-2.8.12.tar.gz
# cd cmake-2.8.12
# ./configure

-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for wsyncup in /usr/lib64/libcurses.so
-- Looking for wsyncup in /usr/lib64/libcurses.so - found
-- Looking for elf.h
-- Looking for elf.h - found
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/bin/f95
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake-qt4 (found version "4.6.2")
-- Performing Test QT4_WORKS
-- Performing Test QT4_WORKS - Success
-- Performing Test run_pic_test
-- Performing Test run_pic_test - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/data/src/about_MySQL/cmake-2.8.12
---------------------------------------------

#make

#make install
-- Installing: /usr/local/share/cmake-2.8/completions/cmake
-- Installing: /usr/local/share/cmake-2.8/completions/cpack
-- Installing: /usr/local/share/cmake-2.8/completions/ctest

# mkdir -p /opt/myslqDatafile
# groupadd mysql
# useradd -s /sbin/nologin -M -g mysql mysql
# chown -Rv mysql:mysql /opt/myslqDatafile
changed ownership of `/opt/myslqDatafile' to mysql:mysql
# tar -xvzf mysql-5.5.35-linux2.6-x86_64.tar.gz
# cd mysql-5.5.35-linux2.6-x86_64
# pwd
/opt/data/src/about_MySQL/mysql-5.5.35-linux2.6-x86_64
#cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/opt/myslqDatafile -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_unicode_ci -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_DEBUG=0

[root@product08-fastfile mysql-5.5.35-linux2.6-x86_64]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/opt/myslqDatafile -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_unicode_ci -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_DEBUG=0
CMake Error: The source directory "/opt/data/src/about_MySQL/mysql-5.5.35-linux2.6-x86_64" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

报错,说是版本不对:
在这里https://downloads.skysql.com/archive/index/p/mysql/v/5.5.35
拉到页面最下方,找到Source Code
下载地址:https://downloads.skysql.com/archives/mysql-5.5/mysql-5.5.35.tar.gz
# cd /opt/data/src/about_MySQL/
# wget https://downloads.skysql.com/archives/mysql-5.5/mysql-5.5.35.tar.gz
--2014-08-11 13:44:03-- https://downloads.skysql.com/archives/mysql-5.5/mysql-5.5.35.tar.gz
Resolving downloads.skysql.com... 46.105.96.115, 2001:41d0:2:cf73::1
Connecting to downloads.skysql.com|46.105.96.115|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21707804 (21M) [application/octet-stream]
Saving to: “mysql-5.5.35.tar.gz”

16% [==============> ] 3,686,171 861K/s eta 39s

# cd mysql-5.5.35
# pwd
/opt/data/src/about_MySQL/mysql-5.5.35

继续:
#cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/opt/myslqDatafile -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_unicode_ci -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_DEBUG=0

-- Found Curses: /usr/lib64/libcurses.so
-- Looking for tputs in /usr/lib64/libcurses.so
-- Looking for tputs in /usr/lib64/libcurses.so - found
-- Looking for include file libaio.h
-- Looking for include file libaio.h - not found
-- Looking for io_queue_init in aio
-- Looking for io_queue_init in aio - not found
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS - Success
-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC
-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC - Success
-- Check size of pthread_t
-- Check size of pthread_t - done
-- Performing Test HAVE_PEERCRED
-- Performing Test HAVE_PEERCRED - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/data/src/about_MySQL/mysql-5.5.35

#make
[100%] Building CXX object mysql-test/lib/My/SafeProcess/CMakeFiles/my_safe_process.dir/safe_process.cc.o
Linking CXX executable my_safe_process
[100%] Built target my_safe_process

# make install
-- Installing: /usr/local/mysql/man/man1/mysqlbug.1
-- Installing: /usr/local/mysql/man/man8/mysqld.8
-- Installing: /usr/local/mysql/support-files/solaris/postinstall-solaris

# cp ./support-files/my-medium.cnf /etc/my.cnf
# chown -Rv mysql:mysql /usr/local/mysql/

# cd /opt/data/src/about_MySQL/mysql-5.5.35
# pwd
/opt/data/src/about_MySQL/mysql-5.5.35
# cp ./support-files/mysql.server /etc/init.d/mysqld
# ll /etc/init.d/mysqld
-rw-r--r--. 1 root root 10877 Aug 11 14:49 /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld
# ll /etc/init.d/mysqld
-rwxr-xr-x. 1 root root 10877 Aug 11 14:49 /etc/init.d/mysqld
# chkconfig mysqld on
# ln -sv /usr/local/mysql/bin/mysqladmin /usr/sbin/mysqladmin
`/usr/sbin/mysqladmin' -> `/usr/local/mysql/bin/mysqladmin'
# ln -sv /usr/local/mysql/bin/mysql /usr/sbin/mysql
`/usr/sbin/mysql' -> `/usr/local/mysql/bin/mysql'
# ln -sv /usr/local/mysql/bin/mysqldump /usr/sbin/mysqldump
`/usr/sbin/mysqldump' -> `/usr/local/mysql/bin/mysqldump'
#vi /etc/my.cnf
在[mysqld]段添加:
basedir = /usr/local/mysql
datadir = /opt/myslqDatafile
tmpdir = /tmp

尝试启动:
#/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/opt/myslqDatafile

# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/opt/myslqDatafile
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/local/mysql//bin/mysqladmin -u root password 'new-password'
/usr/local/mysql//bin/mysqladmin -u root -h product08-fastfile password 'new-password'

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

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

Please report any problems with the /usr/local/mysql//scripts/mysqlbug script!
#/etc/init.d/mysqld start
# /etc/init.d/mysqld start
Starting MySQL.....[ OK ]
# netstat -nlp|grep mysqld
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 31641/mysqld
unix 2 [ ACC ] STREAM LISTENING 769067 31641/mysqld /tmp/mysql.sock

# ps aux|grep mysqld
root 31338 0.0 0.0 106224 1400 pts/3 S 14:59 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/opt/myslqDatafile --pid-file=/opt/myslqDatafile/product08-fastfile.pid
mysql 31641 0.3 0.1 772900 45172 pts/3 Sl 14:59 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/opt/myslqDatafile --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/opt/myslqDatafile/product08-fastfile.err --pid-file=/opt/myslqDatafile/product08-fastfile.pid --socket=/tmp/mysql.sock --port=3306

命令行管理,进入控制台:
# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.35-log 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>
默认密码为空。

设置管理密码:
/usr/local/mysql/bin/mysqladmin password -uroot '123456'

rpm安装MySQL5.5后配置,在centos5上;mysql编译安装在centos6.5上;的更多相关文章

  1. Dockerfile 编译安装mysql5.7 千万不要执行.只是记录一下编译安装罢了

    开启所有核心make  20G 内存都不够玩,跑3-4个核心吧,还好. 最后的出来的镜像3G多,百思不得其解,看了官方的Dockerfile,也没什么特别,就是 apt 或者 yum.好吧,不知做了什 ...

  2. centos7 安装mysql5.7及配置

    一.Mysql 各个版本区别:1.MySQL Community Server 社区版本,开源免费,但不提供官方技术支持.2.MySQL Enterprise Edition 企业版本,需付费,可以试 ...

  3. Linux安装MySql5.7及配置(yum安装)

    Linux安装MySql5.7及配置(yum安装) [root@xld ~]# rpm -q centos-release centos-release-7-7.1908.0.el7.centos.x ...

  4. win8安装mysql5.5最后配置没有反应

    win8安装mysql5.5最后配置没有反应 win8下安装mysql5.5一路顺利,可是到最后一步配置mysql服务及登录password后.注冊服务并启动服务界面一直没有不论什么反应: 本来以为是 ...

  5. Docker安装mysql5.7并且配置主从复制

    Docker安装mysql5.7并且配置主从复制 一.拉取mysql镜像 二.创建文件docker.cnf 2.1 mysql主机(192.168.21.55:3307) 2.1.1 创建文件夹 2. ...

  6. CentOS 6.5 yum安装mysql5.6或其他版本【默认yum只能安装mysql 5.1】 by jason

    by jason [备份配置文件] CentOS 6.5 默认yum只能安装mysql 5.1 安装前要检查机器原来是否安装过mysql,如有安装需要先进行数据备份.清理. [root@snails ...

  7. windows和linux上mysql的安装

    mysql基于多平台,多版本的安装 mysql.tar.gz  链接:https://pan.baidu.com/s/1lG9BNL1mG4qbjM8xLHtrjQ 密码:s4tk MySQL 是一个 ...

  8. 2、mysql编译安装

    2.1前言: 此文档介绍的是cmake编译安装的方式: 二进制的安装方式在linux运维_集群_01中有详细的安装说明(已经编译完成,进行初始操作即可) 初始化操作时需要对编译好的mysql进行一下备 ...

  9. Nginx PHP MySql 编译安装

    以CentOS5.6为平台编译安装.确保系统已经安装gcc/gcc-c++编译器! 1.Nginx-1.0.14 2.PHP-5.3.10 3.MySql-5.1.61 安装相关依赖开发库: auto ...

随机推荐

  1. 【Spring】3、BeanFactory 和 ApplicationContext的区别

    转自:http://blog.csdn.net/intlgj/article/details/5660587 在spring中,两个最基本最重要的包是 org.springframework.bean ...

  2. Mybatis标签bind用法

    Mybatis使用bind元素进行模糊查询,不用在乎数据库是mysql还是oracle从而提高可移植性 使用bind元素传递多个参数 public List<Student> findSt ...

  3. 几个常用T_SQL语句比较

    UNION ALL VS UNION : union all 对两个结果进行并集操作,包括重复行,即所有的结果全部显示,不管是不是重复:union 对两个结果集进行并集操作,不包括重复行,相当于 di ...

  4. agc007D - Shik and Game(dp 单调性)

    题意 题目链接 Sol 主人公的最优决策一定是经过熊->返回到某个位置->收集经过的钻石 那么可以直接设\(f[i]\)表示收集完了前\(i\)个位置的钻石的最小时间,转移的时候枚举下最后 ...

  5. 将textarea实现自适应高度及IE下滚动条不出现的bug

    1.<el-table-column label="备注" width="180"> <template scope="scope& ...

  6. RaPC栅格化多边形裁剪之——进化0.1

    采用整数二维数组进行cell的归属标记,将所有符合条件的cell输出,不进行整体多边形重构,用以统计面积. 上图: INTERSECT: 网格区域为离散化的空间范围,黄色部分为求交结果. differ ...

  7. 页面可见性判断:document.hidden与visibilitychange事件

    我们需要在特定的时候判断页面的显示状态,例如:当视频加载到可播放状态时,根据用户是否停留在当前页面来决定是否开始自动播放.页面的展示的状态的判断就需要用到html5新增的一个api:document. ...

  8. LeetCode题解之Leaf-Similar Trees

    1.题目描述 2.问题分析 将叶子节点的值放入vector,然后比较. 3.代码 bool leafSimilar(TreeNode* root1, TreeNode* root2) { vector ...

  9. 【SPL标准库专题(8)】 Datastructures:SplFixedArray

    SplFixedArray主要是处理数组相关的主要功能,与普通php array不同的是,它是固定长度的,且以数字为键名的数组,优势就是比普通的数组处理更快. 类摘要 SplFixedArray im ...

  10. SQL语句结合上下文查询(in查询)

    在多个表联合查询时,使用linq语句查询就显得不那么方便了,执行效率也不高, SQL语句查询的优势就显现出来了. using (var context = new YZS_TRAEntities()) ...