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

IDLE(集成开发学习环境Integrated Development and Learning Environment)是一个 Python IDE,由 Python 语言本身编写,在 Windows 中通常作为 Python 安装 的一部分而安装。它是初学者的理想选择,使用起来很简单。对于那些正在学习 Python 的人,比如学生,它可以作为一个很好的 IDE 来开始使用。语法高亮、智能识别和自动补全等基本功能是这个 IDE 的一些特点。你可以随时在官方 文档 中了

如何在 Ubuntu 中切换多个 PHP 版本?下面本篇文章给大家介绍一下Ubuntu中切换多个 PHP 版本的方,希望对大家有所帮助!

1.使用快捷键【Ctrl+Alt+T】打开终端命令模式。2.可以通过以下方式重启nginx服务。方法一,在nginx可执行目录sbin下,输入以下命令重启/nginx-sreload#重启方法二,查找当前nginx进程号,然后输入命令:kill-HUP进程号,实现重启nginx服务#ps-ef|grepnginx#查找当前nginx进程号]#kill-TERM132#杀死nginx进程,132为nginx进程号

docker内ubuntu乱码的解决办法:1、通过“locale”查看本地使用的语言环境;2、通过“locale -a”命令查看本地支持的语言环境;3、在“/etc/profile”文件的结尾处添加“export LANG=C.UTF-8”;4、重新加载“source /etc/profile”即可。

ubuntu php无法启动服务的解决办法:1、在php-fpm.conf里面设置错误日志;2、执行“/usr/sbin/php-fpm7.4 --fpm-config /etc/php/fpm/php-fpm.conf”命令;3、修改php的配置文件注释即可。

ubuntu没有php-fpm的解决办法:1、通过执行“sudo apt-get”命令添加php的源地址;2、查看有没有php7的包;3、通过“sudo apt-get install”命令安装PHP;4、修改配置监听9000端口来处理nginx的请求;5、通过“sudo service php7.2-fpm start”启动“php7.2-fpm”即可。

查找无用的镜像首先,您可以检查当前使用的内核,您可以通过命令获得信息:uname-aa.例如,它在我的桌面上显示为:复制代码代码如下:magc@magc-desktop:~$uname-aLinuxmagc-desktop2.6.24-19-RT#1SMPpremptRTThu8月21日02:08336003UTC2008i686GNU/Linux然后通过查看这台机器上所有内核的列表来决定哪些需要删除:运行命令:复制代码代码如下:dpkg-get-selections|greplinux例如,我


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

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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
