mysql多实例安装详解_MySQL
bitsCN.com
首先说明一个场景:我的电脑是ubuntu系统,之前apt-get自动安装过mysql。这也是出现错误最多的原因之一。
安装过程,其中充斥着各种错误:- 6.mkdir mysql
- 7.groupadd mysql
- 8.useradd -r -g mysql mysql
- # make clean
- # rm -f CMakeCache.txt
- # rm -rf /etc/my.cnf
- 9.cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
- -DMYSQL_DATADIR=/usr/local/mysql/data -DDEFAULT_CHARSET=utf8
- -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all
- -DENABLED_LOCAL_INFILE=1
- make
- make install
- cd /usr/local/mysql
- chown -R root:mysql .
- chown -R mysql:mysql data
- 11.cp support-files/my-medium.cnf /etc/my.cnf
- 12.cd /usr/local/mysql
- scripts/mysql_install_db --defaults-file=/usr/local/mysql/data_3308/my.cnf --datadir=/usr/local/mysql/data_3308/
- 第一次的时候我的执行结果是这样的:
- root@zhou:/usr/local/mysql# scripts/mysql_install_db --defaults-file=/usr/local/mysql/data_3307/my.cnf --datadir=/usr/local/mysql/data_3307/
- Installing MySQL system tables...
- 130107 10:25:47 [ERROR] COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8'
- 130107 10:25:47 [ERROR] Aborting
- 130107 10:25:47 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
然后重新进行上面的命令了。直到我们看到这样的结果:表示初始化成功了,恭喜你下面可以进行下面的操作了。
- root@zhou:/usr/local/mysql# mysql_install_db --user=mysql --defaults-file=/usr/local/mysql/data3307/my.cnf --datadir=/usr/local/mysql/data3307/
- Installing MySQL system tables...
- OK
- Filling help tables...
- OK
对了要注意了,权限的分配,一不小心mysql的就无法读取相关文件的权利。
- mysqld_safe --defaults-file=/usr/local/mysql/data_3307/my.cnf &
- 130107 13:35:36 [Note] Server socket created on IP: '0.0.0.0'.
- 130107 13:35:36 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
- 130107 13:35:36 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
- 130107 13:35:36 mysqld_safe mysqld from pid file /usr/local/mysql/data3307/mysql.pid ended
在下次做时,就需要这样的命令了:
- root@zhou:/usr/local/mysql# mysql_install_db --user=mysql --defaults-file=/usr/local/mysql/data3307/my.cnf --datadir=/usr/local/mysql/data3307/ --user=mysql
这里启动了三个mysql服务器后,发现只能登录到3306上面的服务去,而其他的就是没法登录,当我把3307 3306杀掉后,登录mysql确出现错误了,
- root@zhou:/usr/local/mysql/tmp# mysql
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
- root@zhou:/etc/init.d# mysql -h127.0.0.1 -P3307

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics





The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

How to achieve login authorization from within the application to outside the application? In some applications, we often encounter the need to jump from one application to another...

How to implement cross-application jump for Word plug-in login authorization? When using certain Word plugins, we often encounter this scenario: click on the login in the plugin...

Experience the convenience of Flutter hot reloading on the Debian system, just follow the steps below: Install FlutterSDK: First, you need to install FlutterSDK on the Debian system. Visit Flutter official website to download the latest stable version of SDK and decompress to the specified directory (for example, ~/flutter). After that, add Flutter's bin directory to the system PATH environment variable. Edit the ~/.bashrc or ~/.profile file, add the following code: exportPATH="$PATH:~/flutter/bin" Save the file and execute source~/.bas

"DebianStrings" is not a standard term, and its specific meaning is still unclear. This article cannot directly comment on its browser compatibility. However, if "DebianStrings" refers to a web application running on a Debian system, its browser compatibility depends on the technical architecture of the application itself. Most modern web applications are committed to cross-browser compatibility. This relies on following web standards and using well-compatible front-end technologies (such as HTML, CSS, JavaScript) and back-end technologies (such as PHP, Python, Node.js, etc.). To ensure that the application is compatible with multiple browsers, developers often need to conduct cross-browser testing and use responsiveness

XML Online Format Tools automatically organizes messy XML code into easy-to-read and maintain formats. By parsing the syntax tree of XML and applying formatting rules, these tools optimize the structure of the code, enhancing its maintainability and teamwork efficiency.

Discussion on the task status after the local computer of Jiutian Computing Power Platform is closed. Many users will encounter a question when using Jiutian Computing Power Platform for artificial intelligence training...
