注:cmake需要手动安装,一般操作系统中不自带。
The sequence for installation from a compressed tar file or Zip
archive source distribution is similar to the process for
installing from a generic binary distribution (see Section 2.2,
"Installing MySQL from Generic Binaries on Unix/Linux"), except
that it is used on all platforms and includes steps to configure
and compile the distribution. For example, with a compressed tar
file source distribution on Unix, the basic installation command
sequence looks like this:
# Preconfiguration setup
shell> groupadd mysql
shell> useradd -r -g mysql mysql
# Beginning of source-build specific instructions
shell> tar zxvf mysql-VERSION.tar.gz
shell> cd mysql-VERSION
shell> cmake .
shell> make
shell> make install
# End of source-build specific instructions
# Postinstallation setup
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server
A more detailed version of the source-build specific instructions
is shown following.
Note
The procedure shown here does not set up any passwords for MySQL
accounts. After following the procedure, proceed to Section 2.10,
"Postinstallation Setup and Testing," for postinstallation setup
and testing.
Perform Preconfiguration Setup
On Unix, set up the mysql user and group that will be used to run
and execute the MySQL server and own the database directory. For
details, see Creating a mysql System User and Group, in Section
2.2, "Installing MySQL from Generic Binaries on Unix/Linux." Then
perform the following steps as the mysql user, except as noted.
Obtain and Unpack the Distribution
Pick the directory under which you want to unpack the distribution
and change location into it.
Obtain a distribution file using the instructions in Section
2.1.3, "How to Get MySQL."
Unpack the distribution into the current directory:
* To unpack a compressed tar file, tar can uncompress and unpack
the distribution if it has z option support:
shell> tar zxvf mysql-VERSION.tar.gz
If your tar does not have z option support, use gunzip to
unpack the distribution and tar to unpack it:
shell> gunzip < mysql-VERSION.tar.gz | tar xvf -
Alternatively, CMake can uncompress and unpack the
distribution:
shell> cmake -E tar zxvf mysql-VERSION.tar.gz
* To unpack a Zip archive, use WinZip or another tool that can
read .zip files.
Unpacking the distribution file creates a directory named
mysql-VERSION.
Configure the Distribution
Change location into the top-level directory of the unpacked
distribution:
shell> cd mysql-VERSION
Configure the source directory. The minimum configuration command
includes no options to override configuration defaults:
shell> cmake .
On Windows, specify the development environment. For example, the
following commands configure MySQL for 32-bit or 64-bit builds,
respectively:
shell> cmake . -G "Visual Studio 9 2008"
shell> cmake . -G "Visual Studio 9 2008 Win64"
On Mac OS X, to use the Xcode IDE:
shell> cmake . -G Xcode
When you run cmake, you might want to add options to the command
line. Here are some examples:
* -DBUILD_CONFIG=mysql_release: Configure the source with the
same build options used by Oracle to produce binary
distributions for official MySQL releases.
* -DCMAKE_INSTALL_PREFIX=dir_name: Configure the distribution
for installation under a particular location.
* -DCPACK_MONOLITHIC_INSTALL=1: Cause make package to generate a
single installation file rather than multiple files.
* -DWITH_DEBUG=1: Build the distribution with debugging support.
For a more extensive list of options, see Section 2.9.4, "MySQL
Source-Configuration Options."
To list the configuration options, use one of the following
commands:
shell> cmake . -L # overview
shell> cmake . -LH # overview with help text
shell> cmake . -LAH # all params with help text
shell> ccmake . # interactive display
If CMake fails, you might need to reconfigure by running it again
with different options. If you do reconfigure, take note of the
following:
* If CMake is run after it has previously been run, it may use
information that was gathered during its previous invocation.
This information is stored in CMakeCache.txt. When CMake
starts up, it looks for that file and reads its contents if it
exists, on the assumption that the information is still
correct. That assumption is invalid when you reconfigure.
* Each time you run CMake, you must run make again to recompile.
However, you may want to remove old object files from previous
builds first because they were compiled using different
configuration options.
To prevent old object files or configuration information from
being used, run these commands on Unix before re-running CMake:
shell> make clean
shell> rm CMakeCache.txt
Or, on Windows:
shell> devenv MySQL.sln /clean
shell> del CMakeCache.txt
If you build out of the source tree (as described later), the
CMakeCache.txt file and all built files are in the build
directory, so you can remove that directory to object files and
cached configuration information.
If you are going to send mail to a MySQL mailing list to ask for
configuration assistance, first check the files in the CMakeFiles
directory for useful information about the failure. To file a bug
report, please use the instructions in Section 1.7, "How to Report
Bugs or Problems."
下面是一些常用选择:
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
我的opensuse是/etc/init.d/这个目录。
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
修改密码
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h linux-bfss password 'new-password'
Alternatively you can run:
./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 . ; ./bin/mysqld_safe &
测试脚本
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
分享到:
相关推荐
基于spring官方代码,自行搭建springboot+mybatis+mysql示例源代码
刚入门初始化,用VC++开发 FastCGI + MySQL 构建的工程文档,含源代码和MySQL 连接DLL
内容概要:本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心...
内容概要:本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心...
毕业设计,基于SpringBoot+Vue+MySql开发的前后端分离的疫情隔离管理系统,内含完整源代码,数据库脚本,视频教程 项目介绍: 采用java技术构建的一个管理系统。整个开发过程首先对系统进行需求分析,得出系统的...
毕业设计,基于SpringBoot+Bootstrap+MySql开发的大学生毕设选题系统,内含Java完整源代码,数据库脚本 本系统基于ssm以SpringMVC框架模式构建的一个为大学毕业季学生毕设选题的系统,该系统以B/S模式来构建,前端...
* 第三步:源码文件为cucmarket.zip,修改源代码中的settings.py文件,改成自己的mysql数据库用户名和密码 * 第四步:运行命令:python manage.py runserver * 第五步:打开浏览器查看 测试账户 * 普通会员...
与WEB构建相关的,HTML,CSS,PHP,MYSQL所有代码
Java从网络取得文件 1个目标文件 简单 Java从压缩包中提取文件 1个目标文件 简单 Java存储与读取对象 1个目标文件 如题 Java调色板面板源代码 1个目标文件 摘要:Java源码,窗体界面,调色板 使用Java语言编写的一款...
文件包含了一个用php+mysql构建的网站.
本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心内容。通过...
内容深入,从源代码的角度深度解析了InnoDB的体系结构、实现原理、工作机制,并给出了大量最佳实践,能帮助你系统而深入地掌握InnoDB,更重要的是,它能为你设计和管理高性能、高可用的数据库系统提供绝佳的指导。...
基于go、gorm、gin、mysql及layui构建的人力资源管理系统。提供员工管理、考试管理、薪资考勤管理、权限管理及分公司分库数据隔离等功能 - - 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设...
功能概要: ... ... 适用人群: 希望学习Java编程、Swing用户界面设计以及数据库管理的初学者和中级开发人员。...在学习过程中,不仅要阅读代码示例,还要尝试自己编写代码,以便更好地理解和掌握所学内容
内容概要:本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心...
内容概要:本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心...
本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心内容。通过...
本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心内容。通过...
本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心内容。通过...
本系统源代码基于Spring Boot、Vue.js、Element UI和MySQL,提供一个通用的Web应用程序框架。通过该系统源代码,学习如何使用这些技术构建可扩展的管理系统。涵盖前端开发、后端开发、数据库集成等核心内容。通过...