CentOS
这几天在centos下装mysql,这里记录一下安装的过程,方便以后查阅
Mysql5.5.37安装需要cmake,5.6版本开始都需要cmake来编译,5.5以后的版本应该也要装这个。
安装cmake
[root@local ~]# wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz[root@local ~]# tar xvf cmake-2.8.12.2.tar.gz[root@local ~]# cd cmake-2.8.12.2[root@local cmake-2.8.12.2]#./bootstrap[root@local cmake-2.8.12.2]# make[root@local cmake-2.8.12.2]# make install
安装mysql
[root@local ~]# wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.37.tar.gz[root@local ~]# tar xvf mysql-5.5.37.tar.gz[root@local ~]# cd mysql-5.5.37[root@local mysql-5.5.37]# cmake ./
可能还会报这个错,没有就跳过
CMake Error at cmake/readline.cmake:83(MESSAGE):Curses library not found.Pleaseinstall appropriate package,remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name islibncurses5-dev, on Redhat and derivates it is ncurses-devel.Call Stack (most recent call first): cmake/readline.cmake:127 (FIND_CURSES) cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT) CMakeLists.txt:355 (MYSQL_CHECK_READLINE-- Configuring incomplete, errors occurred!See also "/root/my/mysql-5.5.37/CMakeFiles/CMakeOutput.log".See also"/root/my/mysql-5.5.37/CMakeFiles/CMakeError.log".
说明centos系统没有ncurses-devel
[root@local ~]# wgethttp://invisible-island.net/datafiles/release/ncurses.tar.gz[root@local ~]# cd ncurses-5.9[root@local ncurses-5.9]#./configure[root@local ncurses-5.9]# make[root@local ncurses-5.9]# make install
再删除刚才编译生成的 CMakeCache.txt 文件,否则无法进行下一步
[root@local mysql-5.5.37]# rm -f CMakeCache.txt
继续编译mysql
[root@local ~]# cmake ./[root@local ~]# make[root@local ~]# make install
这样,mysql默认将成功安装到/usr/local/mysql
创建mysql用户组
[root@local ~]# groupadd mysql[root@local ~]# useradd –r –g mysql mysql[root@local ~]# chown –R mysql.mysql /usr/local/mysql启动mysql
[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql
这里可能会发生错误,没有就跳过:
FATAL ERROR: Could not find./bin/my_print_defaultsIf you compiled from source, you need torun 'make install' tocopy the software into the correct locationready for operation.If you are using a binary release, you musteither be at the toplevel of the extracted archive, or pass the --basedir optionpointing to that location.
解决方法:
[root@local ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
再启动mysql
[root@local ~]# /usr/local/mysql/bin/mysqld_safe --user=mysql
注册mysql服务,开机自动启动
1.设置mysql配置文件到/etc目录
[root@local ~]# cp /usr/local/mysql/support-files/my-medium.cnf/etc/my.cnf
2.设置mysql开机自启
[root@local ~]# cp/usr/local/mysql/support-files/mysql.server /etc/init.d/mysql[root@local ~]# chmod +x /etc/init.d/mysql[root@local ~]# /sbin/chkconfig --add mysql
3.启动mysql服务
[root@local ~]# service mysql start
测试mysql是否安装成功
[root@local ~]# /usr/local/mysql/bin/mysql -u root -pEnter password: Welcome to the MySQL monitor.Commands end with ; or /g.Your MySQL connection id is 1Server version: 5.5.37 Source distribution Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved. Oracle is a registered trademark of OracleCorporation and/or itsaffiliates. Other names may be trademarksof their respectiveowners. Type 'help;' or '/h' for help. Type '/c' toclear the current input statement. mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql|| performance_schema || test |+--------------------+4 rows in set (0.03 sec)
参考:

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于架构原理的相关内容,MySQL Server架构自顶向下大致可以分网络连接层、服务层、存储引擎层和系统文件层,下面一起来看一下,希望对大家有帮助。

在mysql中,可以利用char()和REPLACE()函数来替换换行符;REPLACE()函数可以用新字符串替换列中的换行符,而换行符可使用“char(13)”来表示,语法为“replace(字段名,char(13),'新字符串') ”。

mysql的msi与zip版本的区别:1、zip包含的安装程序是一种主动安装,而msi包含的是被installer所用的安装文件以提交请求的方式安装;2、zip是一种数据压缩和文档存储的文件格式,msi是微软格式的安装包。

方法:1、利用right函数,语法为“update 表名 set 指定字段 = right(指定字段, length(指定字段)-1)...”;2、利用substring函数,语法为“select substring(指定字段,2)..”。

转换方法:1、利用cast函数,语法“select * from 表名 order by cast(字段名 as SIGNED)”;2、利用“select * from 表名 order by CONVERT(字段名,SIGNED)”语句。

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了关于MySQL复制技术的相关问题,包括了异步复制、半同步复制等等内容,下面一起来看一下,希望对大家有帮助。

本篇文章给大家带来了关于mysql的相关知识,其中主要介绍了mysql高级篇的一些问题,包括了索引是什么、索引底层实现等等问题,下面一起来看一下,希望对大家有帮助。

在mysql中,可以利用REGEXP运算符判断数据是否是数字类型,语法为“String REGEXP '[^0-9.]'”;该运算符是正则表达式的缩写,若数据字符中含有数字时,返回的结果是true,反之返回的结果是false。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor

SublimeText3 English version
Recommended: Win version, supports code prompts!
