我需要基于一个MySQL映像启动一个MySQL容器,该映像具有一个现有数据库作为映像的一部分,并设置为默认数据库。它需要与mysql的非根用户一起运行,因为在我们的私有Kubernetes集群中不允许以root形式运行。引用另一个解决方案,以便使用在Dockerfile下面创建的现有数据库启动MySQL。它在Docker桌面上成功地在本地启动了一个容器,直到我做了一些更改,尝试将容器作为用户mysql运行。
数据库模式是使用mysqdump从VM上的现有数据库输出的,然后输出到eddie_backup2.sql。
Dockerfile:
FROM containerregistry-na.fo
我想跟踪所有MySQL查询而不重新启动服务。我知道我可以不重新启动就启用slow_queries日志。
root in [~]# touch /var/log/slow root in [~]# chown mysql:mysql /var/log/slow root in [~]# mysql -e 'SET GLOBAL slow_query_log=1;' root in [~]# mysql -e 'SET GLOBAL slow_query_log_file="/var/log/slow";'
是否可以将slow_query时间设置得太
以前,我研究过很多与我的问题有关的问题,但这些问题都没有解决我的问题。以下问题:
我遵循了教程:
沿航站楼行驶:
Gustavo-Maci:mysql gus$ export PATH=/usr/local/mysql/bin:$PATH
Gustavo-Mac:mysql gus$ mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
Error: Access denied for user 'root'@'
我在使用mysql的时候有django.db.utils.OperationalError: (1698, "Access denied for user 'root'@'localhost'")。用户名和密码正确:
DB_HOST = '127.0.0.1'
DB_USER = 'root'
DB_PASSWORD = ''
我可以以root用户身份登录mysql:
$ sudo mysql -u root
Welcome to the MySQL monitor. Commands end w
运行14.0.2 LTS版本
服务器重新启动,我无法访问MYSQL。
root@controller:~# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
尝试了所有可能的解决方案,但似乎没有任何效果。
root@controller:~# ps -ef | grep mysql
root 7591 6127 0 18:40 pts/4 00:00:00 grep mysql
如果没有收到以下错误,我无法启动mysqld:
[root@alarm ~]# mysqld
140414 16:01:04 [ERROR] Fatal error: Please read "Security" section of the manua l to find out how to run mysqld as root!
140414 16:01:04 [ERROR] Aborting
140414 16:01:04 [Note] mysqld: Shutdown complete
如果我尝试启动mysql,它会告诉我它无法通过套接字'/run/mys
我不能再在我的码头容器中使用MySQL了:
root@mysql-container:/# mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
mysqld正在运行:
root@mysql-spirit-ssl:
所以我有一个两难的选择。我从另一位开发人员手中接过工作,有一个机器,我只有根用户才能访问它,我需要从它下载MySQL数据库。因此,我使用根目录,在命令行中输入mysql并获取:
Access denied for user 'root'@'localhost' (using password: NO)
然后,我尝试使用mysql --user=root --password={myrootpassword},它显示:
Access denied for user 'root'@'localhost' (using password
我刚买了Coda 2,我想试一下mysql数据库连接的这个功能。我无法连接。出现的错误是:
Unable to connect to host 1.2.3.4, or the request timed out.
Be sure that the address is correct and that you have the necessary privileges,
or try increasing the connection timeout (currently 0 seconds).
MySQL said: Can't connect to MySQL server on
这不是无法通过socket‘/var/lib/mysql.sock连接到本地MySQL服务器的副本
那里的问题是磁盘空间不足。这里没有这样的问题。
我在Redhat Centos 5.5系统上安装了mysql,该系统在重新启动之前运行良好。
该网络应用程序发出:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
当你试图连接它的时候。
我跑不了
root@server [~]# /usr/bin/mysql_secure_installation
.
当我试图从XAMPP运行phpMyAdmin时,我得到了这个错误。在我安装和运行XAMPP之前,这台机器上已经安装了mysql。当我启动XAMPP时,mysql和apache2都启动成功。我可以使用PHP脚本访问mysql数据库,但不能通过phpmyadmin访问。
Error
MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL serve
在安装mysql时,我没有在根密码字段中添加任何内容,但是当我运行mysql -u root时,我仍然得到了Access denied for user 'root'@'localhost'。
我在没有授权表的情况下以安全模式启动mysql,sudo mysql_safe --skip-grant-tables &,然后在没有问题的情况下使用mysql -u root。
然后我做了use mysql; update user set authentication_string=null where user='root';,我得到了:
Q
操作系统
$ uname -a
Linux aurora 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
MySQL
$ mysqladmin --version
mysqladmin Ver 8.42 Distrib 5.7.16, for Linux on x86_64
显然,有东西试图以root的形式登录到mysql服务器上。
service mysql start
但我不知道那是什么。
/var/log/mysql/error.log中与启动服务器相关
一开始我做了
debian@osboxes:~/Desktop$ mysql -u root -p
Command 'mysql' not found, but can be installed with:
sudo apt install mysql-client-core-8.0 # version 8.0.18-0ubuntu0.19.10.1, or
sudo apt install mariadb-client-core-10.3 # version 1:10.3.20-0ubuntu0.19.10.1
然后我安装了
debian@osboxes:~/D
我一直在犯这个错误。我一直在看一些QA网站,试图重新设置我的本地mysql我已经在[mysqld]下添加了D1,现在我在安全模式下运行。我遵循了这些步骤
mysqld_safe --skip-grant-tables &
use mysql;
update user set password=PASSWORD(”my_password”) where user=’root’;
当我进入更新的最后一步时,我会得到以下错误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that cor
我正在测试脚本中设置PDO连接:
use app\SomeDAO;
class SomeTest extends \PHPUnit_Framework_TestCase
{
protected $db;
public function setUp()
{
$dsn = "mysql:host=localhost;dbname=baseball;user=root;password=root";
$this->db = new PDO($dsn);
}
我收到一个错误:
PDOException: SQL
我在服务器上安装了UbuntuServer15.04和MariaDB 10.0.17。
当安装MariaDB时,我看不到密码设置页面,并且安装已经完成。
因此,我尝试使用SET密码和UPDATE表更改根密码。
但是,没有发生。
我可以使用任何密码而不使用密码访问MySQL。
如下所示:
root@kuroneko-Server:~# mysql -uroot -p
Enter password: [Type 'itsnotpassword']
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your Mar
在重新启动服务器之后,除了"mysql“之外,一切都正常启动,我尝试手动启动"/etc/init.d/mysql restart”,或者使用"service mysql restart“启动它,它失败了。
在日志文件中写着:
Jul 16 08:13:38 localhost /etc/init.d/mysql[18136]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jul 16 08
我在Ubuntu上使用MySQL遇到了一些困难。刚刚安装了Apache、MySQL、PHP和phpMyAdmin。phpMyAdmin给出:
#1045 Cannot log in to the MySQL server
每一次登录尝试。我试过用户名'root‘和空密码,用户名'root’和密码'root',用户名'mysql‘和密码'mysql',用户名'mysql’和密码'root‘。
当我试图在终端中运行Access denied for user root@x.x.x.x时,也会得到mysql错误:
mysql -
我已经启动了标准mysql容器,现在希望创建一个用户并将特权授予他。但什么也没发生,我收到警告:
MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work
我对mysql不太熟悉--那么我在这里应该做什么呢?
一个更好的解决方案是使用额外的sql脚本启动这个容器。
如何用这样的脚本启动容器:
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'myuse