AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[mysql](ubuntu)

Martin Hope
mstdmstd
Asked: 2024-10-27 15:57:20 +0800 CST

有时我会收到错误“未找到 MySQL 配置”。如何修复?

  • 5

有一段时间我的 MySQL 服务器停止工作了(几个月前我在家里安装了 kubuntu 22.04)

我检查命令:

# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@master-at-home:/path# mysql -h 127.0.0.1 -P 3306 -u root
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1:3306' (111)
root@master-at-home:/path# sudo service mysql start
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xeu mysql.service" for details.
root@master-at-home:/path# systemctl status mysql.service
× mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2024-10-27 09:33:42 EET; 10s ago
Process: 32412 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
CPU: 2ms

master-at-home systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
master-at-home systemd[1]: Stopped MySQL Community Server.
master-at-home systemd[1]: mysql.service: Start request repeated too quickly.
master-at-home systemd[1]: mysql.service: Failed with result 'exit-code'.
master-at-home systemd[1]: Failed to start MySQL Community Server.
root@master-at-home:/path# journalctl -xeu mysql.service
░░ The job identifier is 3931 and the job result is done.
master-at-home systemd[1]: Starting MySQL Community Server...
░░ Subject: A start job for unit mysql.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit mysql.service has begun execution.
░░
░░ The job identifier is 3931.
master-at-home mysql-systemd-start[32412]: MySQL configuration not found at /etc/mysql/my.cnf. Please create one.
master-at-home systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStartPre= process belonging to unit mysql.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
master-at-home systemd[1]: mysql.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit mysql.service has entered the 'failed' state with result 'exit-code'.
master-at-home systemd[1]: Failed to start MySQL Community Server.
░░ Subject: A start job for unit mysql.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit mysql.service has finished with a failure.
░░
░░ The job identifier is 3931 and the job result is failed.
master-at-home systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ Automatic restarting of the unit mysql.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
master-at-home systemd[1]: Stopped MySQL Community Server.
░░ Subject: A stop job for unit mysql.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A stop job for unit mysql.service has finished.
░░
░░ The job identifier is 4065 and the job result is done.
master-at-home systemd[1]: mysql.service: Start request repeated too quickly.
master-at-home systemd[1]: mysql.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit mysql.service has entered the 'failed' state with result 'exit-code'.
master-at-home systemd[1]: Failed to start MySQL Community Server.
░░ Subject: A start job for unit mysql.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit mysql.service has finished with a failure.
░░
░░ The job identifier is 4065 and the job result is failed.

我找到了以下行:

 master-at-home mysql-systemd-start[32412]: MySQL configuration not found at /etc/mysql/my.cnf. Please create one.

我根本没有 /etc/mysql/ 子目录。我不知道为什么会这样,以及如何在我的操作系统中恢复 /etc/mysql/my.cnf?

uname -a
Linux master-at-home 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May  7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

我决定升级我的操作系统但在消息中收到以下错误:

path# sudo apt-get update
Hit:1 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
Hit:2 http://ua.archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:5 https://ppa.launchpadcontent.net/giuspen/ppa/ubuntu jammy InRelease
Hit:6 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Hit:7 https://ppa.launchpadcontent.net/openswoole/ppa/ubuntu jammy InRelease
Reading package lists... Done
path# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  php-common php-mcrypt php-mongodb php8.2-mongodb php8.3-mcrypt php8.3-mongodb
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-server-8.0 (8.0.28-0ubuntu4) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 2
Setting up elasticsearch (8.15.3) ...
/usr/share/elasticsearch/bin/elasticsearch-env: line 78: source: /etc/default/elasticsearch: is a directory
dpkg: error processing package elasticsearch (--configure):
 installed elasticsearch package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
 mysql-server-8.0
 elasticsearch
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

这些问题有关联吗?如何解决?

我的 SQL 安装已默认,没有任何特定选项......

更新:

path# sudo apt install --reinstall mysql-server-8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 6 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for mysql-server-8.0:amd64
path# sudo apt install --reinstall mysql-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 6 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for mysql-server:amd64

更新 # 2:

# sudo apt purge mysql-server-8.0 && sudo apt install --reinstall mysql-server-8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-template-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
mysql-server* mysql-server-8.0*
0 upgraded, 0 newly installed, 2 to remove and 6 not upgraded.
3 not fully installed or removed.
After this operation, 1 713 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 288059 files and directories currently installed.)
Removing mysql-server (8.0.28-0ubuntu4) ...
Removing mysql-server-8.0 (8.0.28-0ubuntu4) ...
Setting up elasticsearch (8.15.3) ...
/usr/share/elasticsearch/bin/elasticsearch-env: line 78: source: /etc/default/elasticsearch: is a directory
dpkg: error processing package elasticsearch (--configure):
installed elasticsearch package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
elasticsearch
E: Sub-process /usr/bin/dpkg returned an error code (1)

我仍然根本没有 /etc/mysql/ 子目录。

更新 # 3:

我嘟嘟地退出:

whoami
master

运行命令:

master@master-at-home:path$ sudo apt purge elasticsearch && sudo apt install mysql-server-8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libcgi-fast-perl libcgi-pm-perl libfcgi-bin libfcgi-perl libfcgi0ldbl libhtml-template-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
elasticsearch*
0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.
1 not fully installed or removed.
After this operation, 1 179 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 288042 files and directories currently installed.)
Removing elasticsearch (8.15.3) ...
Stopping elasticsearch service... OK
(Reading database ... 286653 files and directories currently installed.)
Purging configuration files for elasticsearch (8.15.3) ...
dpkg: warning: elasticsearch: conffile '/etc/default/elasticsearch' is not a plain file or symlink (= '/etc/default/elasticsearch')
Deleting security auto-configuration directory...OK
dpkg: warning: while removing elasticsearch, directory '/var/lib/elasticsearch' not empty so not removed
dpkg: warning: while removing elasticsearch, directory '/usr/lib/systemd/system' not empty so not removed
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
tinyca
The following NEW packages will be installed:
mysql-server-8.0
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/1 386 kB of archives.
After this operation, 1 603 kB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 286641 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.28-0ubuntu4_amd64.deb ...
grep: /etc/mysql/: No such file or directory
Unpacking mysql-server-8.0 (8.0.28-0ubuntu4) ...
Setting up mysql-server-8.0 (8.0.28-0ubuntu4) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
mysql-server-8.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
mysql
  • 1 个回答
  • 49 Views
Martin Hope
gokacinlar
Asked: 2024-09-30 03:11:36 +0800 CST

Ubuntu 24.04.1 XAMPP MySQL 数据库无法启动?

  • 5

我试图从刚刚在全新 Ubuntu 24.04.1 系统上安装的 XAMPP (8.2.12) 打开 MySQL 数据库。当 Apache Web 服务器和 ProFTPD 正在运行时,MySQL 拒绝启动:

XAMPP 面板错误状态

这是完整的错误日志:

2024-09-29 22:01:48 401639 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
2024-09-29 22:01:48 0 [Note] Starting MariaDB 10.4.32-MariaDB source revision c4143f909528e3fab0677a28631d10389354c491 as proces2024-09-29 22:01:48 0 [Note] Using unique option prefix 'key_buffer' is error-prone and can break in the future. Please use the full name 'key_buffer_size' instead.
s 401794
2024-09-29 22:01:48 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-09-29 22:01:48 0 [Note] InnoDB: Uses event mutexes
2024-09-29 22:01:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-09-29 22:01:48 0 [Note] InnoDB: Number of pools: 1
2024-09-29 22:01:48 0 [Note] InnoDB: Using SSE2 crc32 instructions
2024-09-29 22:01:48 0 [ERROR] mysqld: Can't create/write to file '/tmp/user/0/ib6ZuSDa' (Errcode: 13 "Permission denied")
2024-09-29 22:01:48 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2024-09-29 22:01:48 0 [ERROR] mysqld: Can't create/write to file '/tmp/user/0/ibXs4LuJ' (Errcode: 13 "Permission denied")
2024-09-29 22:01:48 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2024-09-29 22:01:48 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-09-29 22:01:48 0 [Note] InnoDB: Starting shutdown...
2024-09-29 22:01:48 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-09-29 22:01:48 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-09-29 22:01:48 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2024-09-29 22:01:48 0 [ERROR] Aborting
2024-09-29 22:01:48 401639 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/immanuel.pid ended
2024-09-29 22:06:09 405682 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
2024-09-29 22:06:09 0 [Note] Starting MariaDB 10.4.32-MariaDB source revision c4143f909528e3fab0677a28631d10389354c491 as process 405833
2024-09-29 22:06:09 0 [Note] Using unique option prefix 'key_buffer' is error-prone and can break in the future. Please use the full name 'key_buffer_size' instead.
2024-09-29 22:06:09 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-09-29 22:06:09 0 [Note] InnoDB: Uses event mutexes
2024-09-29 22:06:09 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-09-29 22:06:09 0 [Note] InnoDB: Number of pools: 1
2024-09-29 22:06:09 0 [Note] InnoDB: Using SSE2 crc32 instructions
2024-09-29 22:06:09 0 [ERROR] mysqld: Can't create/write to file '/tmp/user/0/ibyJHfgh' (Errcode: 13 "Permission denied")
2024-09-29 22:06:09 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2024-09-29 22:06:09 0 [ERROR] mysqld: Can't create/write to file '/tmp/user/0/ibXryd3L' (Errcode: 13 "Permission denied")
2024-09-29 22:06:09 0 [ERROR] InnoDB: Unable to create temporary file; errno: 13
2024-09-29 22:06:09 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-09-29 22:06:09 0 [Note] InnoDB: Starting shutdown...
2024-09-29 22:06:10 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-09-29 22:06:10 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-09-29 22:06:10 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2024-09-29 22:06:10 0 [ERROR] Aborting
2024-09-29 22:06:10 405682 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/immanuel.pid ended

我尝试过许多像这样的解决方案,但似乎都没有效果。

mysql
  • 1 个回答
  • 11 Views
Martin Hope
wouter205
Asked: 2024-04-30 15:18:08 +0800 CST

哎呀,使用MySQL作为用户后端的VSFTP服务在尝试读取用户列表文件`/etc/vsftpd.user_list`时出错了。这可能是由于文件不存在、权限问题或者配置错误导致的。你需要检查一下这个文件是否存在,以及VSFTP服务是否有权限访问它。同时,也要确保你的VSFTP配置文件中关于MySQL后端的设置是正确的。如果问题依旧,可能需要进一步检查MySQL数据库中的用户信息是否完整,以及VSFTP服务是否能够正确地与MySQL数据库进行交互。

  • 5

我想在Ubuntu 22.04.4上搭建一个使用MySQL作为后端存储用户的VSFTP服务器。

我参考了这个指南来设置(它是针对CentOS的,但除了pam_mysql.so部分外,也适用于Ubuntu)。

以下是我的配置:

  • /etc/vsftpd.conf
匿名访问禁用
被动模式地址解析启用
被动模式地址设置为ftp.company.com
被动模式端口范围40000到41000

本地用户启用
写入权限启用
本地用户默认权限掩码022
启用目录消息
启用传输日志
允许从端口20连接

以vsftpd用户身份运行
将本地用户限制在chroot环境中
启用监听
PAM服务名称设置为vsftpd
启用用户列表
启用TCP包装器
允许访客访问
访客用户名设置为vsftpd
本地用户的根目录为/home/vsftpd/$USER
用户替换标记为$USER
使用本地权限的虚拟用户
允许可写的chroot环境
启用被动模式
  • /etc/pam.d/vsftpd
#%PAM-1.0
会话 可选 pam_keyinit.so 强制撤销
认证 必须 pam_mysql.so 用户=vsftpd 密码=mypassword 主机=localhost 数据库=vsftpd 表=accounts 用户列=username 密码列=pass 加密=3
账户 必须 pam_mysql.so 用户=vsftpd 密码=mypassword 主机=localhost 数据库=vsftpd 表=accounts 用户列=username 密码列=pass 加密=3
  • MySQL账户表
mysql> select * from accounts;
+----+-----------------------------------+----------------------------------+
| id | username                          | pass                             |
+----+-----------------------------------+----------------------------------+
|  1 | [email protected]               | [密码哈希]                   |
+----+-----------------------------------+----------------------------------+
1 行数据 (0.00 秒)

在VirtualBox上的本地测试服务器上一切正常,但当我在生产服务器上使用相同的配置时,使用WinSCP连接FTP服务器时出现了这个错误:

OOPS: 无法读取用户列表文件:/etc/vsftpd.user_list

显然vsftpd没有使用MySQL连接来检索用户,而是在寻找一个缺失的用户列表文件。

到目前为止,我已经检查了以下内容:

  • 确认安装了libpam-mysql和mysql-client
  • 确保可以使用vsftpd的凭证连接到MySQL数据库
  • 禁用了iptables,以免干扰数据库连接

但到目前为止,我还没有解决这个问题。令人沮丧的是,它在我的VirtualBox实例中工作正常,但我看不出这个实例和生产实例之间有任何区别。

请问我该如何排查vsftpd和MySQL之间的连接问题?

我的生产环境:

  • Ubuntu 22.04.4
  • MySQL 8.0.36
  • vsftpd 3.0.5
  • iptables v1.8.7
mysql
  • 1 个回答
  • 81 Views
Martin Hope
Ray
Asked: 2024-02-04 07:35:26 +0800 CST

SLURM 控制器守护程序启动时出现问题

  • 6

我正在尝试在 Ubuntu 23.10 系统上配置 SLURM,以便它通过slurmdbd. 这是我通过随机猜测解决的先前问题的延续......

有趣的是,SLURM 控制器 ( slurmctld) 无法在启动时启动。但是,当我手动重新启动该服务时,它看起来很好。

例如,如果我sudo service slurmctld status在启动后键入,我会看到以下消息:

Feb 03 17:10:26 mycomputer slurmctld[1682]: slurmctld: error: Sending PersistInit msg: Connection refused
Feb 03 17:10:26 mycomputer slurmctld[1682]: slurmctld: accounting_storage/slurmdbd: clusteracct_storage_p_register_ctld: Registering slurmctld at port 6817 with slurmdbd
Feb 03 17:10:26 mycomputer slurmctld[1682]: slurmctld: No memory enforcing mechanism configured.
Feb 03 17:10:27 mycomputer slurmctld[1682]: WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
Feb 03 17:10:27 mycomputer slurmctld[1682]: slurmctld: error: mysql_real_connect failed: 2002 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Feb 03 17:10:27 mycomputer slurmctld[1682]: slurmctld: fatal: You haven't inited this storage yet.
Feb 03 17:10:27 mycomputer systemd[1]: slurmctld.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 17:10:27 mycomputer systemd[1]: slurmctld.service: Failed with result 'exit-code'.

这与日志文件中的信息类似/var/log/。但是,如果我使用 重新启动它sudo service slurmctld restart,而不更改任何配置文件,它将在日志中显示以下内容:

Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: Recovered information about 0 jobs
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: select/cons_tres: part_data_create_array: select/cons_tres: preparing for 1 partitions
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: Recovered state of 0 reservations
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: read_slurm_conf: backup_controller not specified
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: select/cons_tres: select_p_reconfigure: select/cons_tres: reconfigure
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: select/cons_tres: part_data_create_array: select/cons_tres: preparing for 1 partitions
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: Running as primary controller
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: No parameter for mcs plugin, default values set
Feb 03 23:22:57 mycomputer slurmctld[30777]: slurmctld: mcs: MCSParameters = (null). ondemand set.
Feb 03 23:23:02 mycomputer slurmctld[30777]: slurmctld: SchedulerParameters=default_queue_depth=100,max_rpc_cnt=0,max_sched_time=2,partition_job_depth=0,sched_max_job_start=0,...

现在看起来还不错。

slurmdbd我唯一的猜测是,这可能与、slurmd、 和slurmctld服务的启动顺序有关。但我一直假设默认顺序是正确的。也许这个假设是错误的?

mysql
  • 1 个回答
  • 23 Views
Martin Hope
mstdmstd
Asked: 2023-11-01 22:53:20 +0800 CST

如何在远程 ubuntu 20 上替换 phpmyadmin 的登录用户?

  • 7

我需要在远程 Ubuntu 20 上替换 phpMyAdmin 的登录用户。

我打开文件/etc/phpmyadmin/config.inc.php并修改$dbuser参数:

# $dbuser='phpmyadmin';

$dbuser='NewUser';

$dbpass='Newpassword';
$basepath='';
$dbname='phpmyadmin';
$dbserver='localhost';
$dbport='3306';
$dbtype='mysql';

我可以使用NewUser和登录,但我也可以使用和Newpassword进入系统。我之前的登录 - 不起作用(我在上面评论过)。rootNewpasswordphpmyadmin

我用命令重新启动了 Apache:

sudo service apache2 restart

如何禁用rootphpMyAdmin 用户?

事实上,我的开发网站被黑了,我丢失了 MySQL 上的所有数据。没什么大不了的,因为它只是开发站点,但如何使我的站点更安全?我认为将登录更改为 phpMyAdmin 是一个步骤...还有其他吗?

mysql
  • 1 个回答
  • 43 Views
Martin Hope
Hawk007
Asked: 2023-08-11 06:03:09 +0800 CST

Joomla 4 MySQL 未完全初始化问题

  • 5

我在尝试运行 Joomla 网站时收到此错误:

用户“testuser”@“localhost”的访问被拒绝(使用密码:YES)

现在,事情就是这样。我刚刚将 Joomla 4 站点从一台 VPS 迁移到了这个新的 VPS。旧的mysql版本是5.7。新版本是 8.0 另外在我的最后一个 VPS 上 php 是版本 8.0 新版本是 8.1

我在新的VPS上创建了一个数据库,并通过putty/console登录,并通过mysql SOURCE安装了数据库。

这导致了上述问题,所以我尝试通过phpmyadmin导入数据库。导入没有任何问题。

网页顶部还显示: mysqli 对象未完全初始化

所以不确定问题是什么。

任何想法表示赞赏。我不确定我错过了什么。我还安装了letsencryps ssl,但这似乎也不起作用。

谢谢。

结束语:我刚刚尝试使用 root 用户,该网站工作正常。因此,当使用测试用户时,GRANT 权限会阻止站点打开。有什么想法可以解决这个问题或为测试用户授予完整的授予权限吗?

谢谢

以下是也会产生的一些错误:

错误:mysqli 对象未完全初始化

在 /var/www/public_html/mywebsitedomain.com/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137 在 mysqli->prepare() (/var/www/public_html/mywebsitedomain.com/libraries/供应商/joomla/database/src/Mysqli/MysqliStatement.php:137) 在 Joomla\Database\Mysqli\MysqliStatement->__construct() (/var/www/public_html/mywebsitedomain.com/libraries/vendor/joomla/database/src /Mysqli/MysqliDriver.php:1089) 在 Joomla\Database\Mysqli\MysqliDriver->prepareStatement() (/var/www/public_html/mywebsitedomain.com/libraries/vendor/joomla/database/src/DatabaseDriver.php:1900)在 Joomla\Database\DatabaseDriver->setQuery() (/var/www/public_html/mywebsitedomain.com/libraries/src/Menu/SiteMenu.php:166) 在 Joomla\CMS\Menu\SiteMenu->Joomla\CMS\Menu {closure}() (/var/www/public_html/mywebsitedomain.com/libraries/src/Cache/Controller/CallbackController.php:51) 在 Joomla\CMS\Cache\Controller\CallbackController->get() (/var/www/public_html/mywebsitedomain.com/libraries/src/Menu/SiteMenu .php:179) 在 Joomla\CMS\Menu\SiteMenu->load() (/var/www/public_html/mywebsitedomain.com/libraries/src/Menu/AbstractMenu.php:333) 在 Joomla\CMS\Menu\AbstractMenu ->getMenu() (/var/www/public_html/mywebsitedomain.com/libraries/src/Menu/AbstractMenu.php:164) 在 Joomla\CMS\Menu\AbstractMenu->getItem() (/var/www/public_html/ mywebsitedomain.com/libraries/src/Application/SiteApplication.php:422) 在 Joomla\CMS\Application\SiteApplication->getTemplate() (/var/www/public_html/mywebsitedomain.com/libraries/src/Error/Renderer/HtmlRenderer .php:50) 在 Joomla\CMS\Error\Renderer\HtmlRenderer->render() (/var/www/public_html/mywebsitedomain.php)com/libraries/src/Exception/ExceptionHandler.php:121) 在 Joomla\CMS\Exception\ExceptionHandler::render() (/var/www/public_html/mywebsitedomain.com/libraries/src/Exception/ExceptionHandler.php:72 )在 Joomla\CMS\Exception\ExceptionHandler::handleException() (/var/www/public_html/mywebsitedomain.com/libraries/src/Application/CMSApplication.php:322) 在 Joomla\CMS\Application\CMSApplication->execute( ) (/var/www/public_html/mywebsitedomain.com/includes/app.php:61) 在 require_once('/var/www/public_html/mywebsitedomain.com/includes/app.php') (/var/www/public_html /mywebsitedomain.com/index.php:32)handleException() (/var/www/public_html/mywebsitedomain.com/libraries/src/Application/CMSApplication.php:322) 在 Joomla\CMS\Application\CMSApplication->execute() (/var/www/public_html/mywebsitedomain.php) com/includes/app.php:61) 在 require_once('/var/www/public_html/mywebsitedomain.com/includes/app.php') (/var/www/public_html/mywebsitedomain.com/index.php:32)handleException() (/var/www/public_html/mywebsitedomain.com/libraries/src/Application/CMSApplication.php:322) 在 Joomla\CMS\Application\CMSApplication->execute() (/var/www/public_html/mywebsitedomain.php) com/includes/app.php:61) 在 require_once('/var/www/public_html/mywebsitedomain.com/includes/app.php') (/var/www/public_html/mywebsitedomain.com/index.php:32)

[1/2] mysqli_sql_exception mysqli_sql_exception:用户“TheDrumCoach”@“localhost”访问被拒绝(使用密码:YES)

在 /var/www/public_html/mywebsitedomain.com/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:310 在 mysqli->real_connect() (/var/www/public_html/mywebsitedomain.com/libraries/供应商/joomla/database/src/Mysqli/MysqliDriver.php:310) 在 Joomla\Database\Mysqli\MysqliDriver->connect() (/var/www/public_html/mywebsitedomain.com/libraries/vendor/joomla/session/src /Handler/DatabaseHandler.php:233) 在 Joomla\Session\Handler\DatabaseHandler->open() 在 session_start() (/var/www/public_html/mywebsitedomain.com/libraries/vendor/joomla/session/src/Storage/ NativeStorage.php:478) 在 Joomla\Session\Storage\NativeStorage->start() (/var/www/public_html/mywebsitedomain.com/libraries/src/Session/Storage/JoomlaStorage.php:295) 在 Joomla\CMS\ Session\Storage\JoomlaStorage->start() (/var/www/public_html/mywebsitedomain.html)com/libraries/vendor/joomla/session/src/Session.php:406) 在 Joomla\Session\Session->start() (/var/www/public_html/mywebsitedomain.com/libraries/vendor/joomla/session/src /Session.php:333) 在 Joomla\Session\Session->has() (/var/www/public_html/mywebsitedomain.com/libraries/src/Session/Session.php:194) 在 Joomla\CMS\Session\Session ->get() (/var/www/public_html/mywebsitedomain.com/libraries/src/Factory.php:374) 在 Joomla\CMS\Factory::getUser() (/var/www/public_html/mywebsitedomain.com/库/src/Application/SiteApplication.php:562) 在 Joomla\CMS\Application\SiteApplication->initialiseApp() (/var/www/public_html/mywebsitedomain.com/libraries/src/Application/SiteApplication.php:226) Joomla\CMS\Application\SiteApplication->doExecute() (/var/www/public_html/mywebsitedomain.com/libraries/src/Application/CMSApplication.php:293) 在 Joomla\CMS\Application\CMSApplication->execute() (/var/www/public_html/mywebsitedomain.com/includes/app.php:61) 在 require_once('/var/www/public_html/mywebsitedomain.com/包括/app.php')(/var/www/public_html/mywebsitedomain.com/index.php:32)

mysql
  • 1 个回答
  • 44 Views
Martin Hope
obeN
Asked: 2023-07-28 18:22:23 +0800 CST

MariaDB log_error系统变量、Ubuntu 20.04和22.04配置文件差异

  • 5

Ubuntu 20.04(焦窝)

# dpkg -l | grep mariadb-server-10
ii  mariadb-server-10.3             1:10.3.38-0ubuntu0.20.04.1        amd64        MariaDB database server binaries

# grep -E 'skip_log_error|syslog|log_error' /etc/mysql/ -R | grep -v '#'
/etc/mysql/mariadb.conf.d/50-server.cnf:log_error = /var/log/mysql/error.log
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:skip_log_error
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:syslog

# tail -2 /var/log/mysql/error.log
2023-07-28  8:30:23 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.38-MariaDB-0ubuntu0.20.04.1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Ubuntu 20.04

Ubuntu 22.04(果酱水母)

# dpkg -l | grep mariadb-server-10
ii  mariadb-server-10.6             1:10.6.12-0ubuntu0.22.04.1

# grep -E 'skip_log_error|syslog|log_error' /etc/mysql/ -R | grep -v '#'
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:skip_log_error
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:syslog

# tail -2 /var/log/mysql/error.log
tail: cannot open '/var/log/mysql/error.log' for reading: No such file or directory

在 Ubuntu 22.04 之前,MariaDB 日志被写入/var/log/mysql/error.log. 由于log_error系统变量显然已在 Ubuntu 22.04 中从 中删除/etc/mysql/mariadb.conf.d/50-server.cnf,因此情况不再如此。

  • 为什么log_error从配置文件中删除/etc/mysql/mariadb.conf.d/50-server.cnf?
  • /var/log/mysql/error.log尽管skip_log_error默认情况下使用 日志文件,为什么在 Ubuntu 20.04 中仍然创建日志文件?
    • 我认为这是由于配置文件的处理顺序造成的,如果是这样,我在哪里可以看到它?

附注
在安装 MariaDB 之前,日志文件不存在。

# ls /var/log/mysql/error.log
ls: cannot access '/var/log/mysql/error.log': No such file or directory
# dpkg -l | grep mariadb-server-10
# apt install mariadb-server
(...)
# dpkg -l | grep mariadb-server-10
ii  mariadb-server-10.3             1:10.3.38-0ubuntu0.20.04.1        amd64        MariaDB database server binaries
# ls /var/log/mysql/error.log
/var/log/mysql/error.log
mysql
  • 2 个回答
  • 33 Views
Martin Hope
Roman Rdgz
Asked: 2023-05-19 16:23:37 +0800 CST

ERROR 2002 (HY000): 删除一些包后无法通过套接字连接到本地 MySQL 服务器

  • 5

因此,我的安全部门要求我从某台 Ubuntu 机器上删除一些未使用的软件包,因为它们的存在会带来安全风险,以防某些入侵者获得访问权限:

  • /usr/bin/g++
  • /usr/bin/gcc
  • /usr/bin/gdb
  • /usr/bin/制作
  • /usr/bin/nc
  • /usr/bin/netcat
  • /usr/bin/perl

在删除它们之后,对 MySQL 服务器的访问就丢失了。起初服务被屏蔽了,所以我揭开它并重新开始。尝试重新启动服务,甚至取消注释 cnf 文件中的套接字行以确保套接字是在 /var/lib/mysql/mysql.sock 中创建的……但这些都不起作用。

我不知道 mysql 服务器是否真的需要这些包中的一个,或者这是否是一个奇怪的巧合,但是关于尝试什么的一些建议会很好。

mysql
  • 1 个回答
  • 18 Views
Martin Hope
reinforcers
Asked: 2023-01-24 20:32:58 +0800 CST

ubuntu 22.04 上的 docker mysql 5.7

  • 5

我习惯使用 Ubuntu 20.04 和这样创建的 docker mysql:

sudo docker run --name mysql-57-container -p 127.0.0.1:3310:3306 -e MYSQL_ROOT_PASSWORD=. -d --volume=/usr/share/docker/mysql57/conf.d:/etc/mysql/conf.d --volume=/usr/share/docker/mysql57/data:/var/lib/mysql mysql:5.7

之后我可以使用它访问它,mysql -u root -p --host=127.0.0.1 --port=3310即使我在同一台机器上安装了 mysql 8.0

我尝试使用相同的设置,所以我在 Ubuntu 22.04 机器上执行了相同的 docker 命令,但是当我尝试访问它时出现此错误ERROR 1130 (HY000): Host '172.17.0.1' is not allowed to connect to this MySQL server我希望任何人都可以帮助我这是为什么?之前谢谢

mysql
  • 2 个回答
  • 54 Views
Martin Hope
SEOSatu
Asked: 2022-11-30 23:26:54 +0800 CST

使用 Cronjob 自动备份 MySQL 数据库

  • 4

我想用 cron 作业备份我的 MySQL 数据库,但我无法让它工作。

这是我正在使用的代码:

0 2 * * * mysqldump -u root toko_db | gzip > /var/backup/toko_db_`date '+%Y-%m-%d'`.sql.gz
mysql
  • 1 个回答
  • 28 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve