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
    • 最新
    • 标签
主页 / unix / 问题

问题[mysql](unix)

Martin Hope
karthik nair
Asked: 2022-04-25 09:45:58 +0800 CST

无法安装 MySQL 工作台

  • 0

当我尝试安装官方 MySQL Workbench 时,它显示 libproj19 不可用的依赖问题。但是,当我尝试从 APT 安装时,存储库只有 libproj22。

有人可以帮我吗?

System:   Host: cosmic Kernel: 5.16.19-76051619-generic x86_64 bits: 64
    Console: pty pts/1 Distro: Pop!_OS 22.04 LTS

karthik@cosmic:~/Downloads$ sudo dpkg -i mysql-workbench-community_8.0.28-1ubuntu21.10_amd64.deb
Selecting previously unselected package mysql-workbench-community.
(Reading database ... 629535 files and directories currently installed.)
Preparing to unpack mysql-workbench-community_8.0.28-1ubuntu21.10_amd64.deb ...
Unpacking mysql-workbench-community (8.0.28-1ubuntu21.10) ...
dpkg: dependency problems prevent configuration of mysql-workbench-community:
mysql-workbench-community depends on libproj19 (>= 7.2.0); however:
Package libproj19 is not installed.

dpkg: error processing package mysql-workbench-community (--install):
dependency problems - leaving unconfigured
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:
mysql-workbench-community
karthik@cosmic:~/Downloads$ sudo apt install libproj19
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libproj19 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libproj19' has no installation candidate

karthik@cosmic:~/Downloads$ apt list -i | grep "libproj"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libproj22/jammy,now 8.2.1-1 amd64 [installed]
karthik@cosmic:~/Downloads$
apt mysql
  • 2 个回答
  • 1549 Views
Martin Hope
setdebarr
Asked: 2022-04-14 13:18:30 +0800 CST

如何确定mysql是否使用挂载目录下的目录?

  • 1

我目前使用 MySQL/home/foo/data/database作为其数据目录。作为/home/foo/data/database已安装的 raid 1 阵列。我遇到的问题是,在启动时,MySQL 每隔一段时间就会在 raid 阵列安装到之前启动/home/foo/data/database,因此 MySQL/home/foo/data/database在根驱动器上使用它的 datadir 而不是安装的 raid 阵列。这会导致问题,因为当我查看 RAID 阵列状态、已安装的分区和 MySQL 时,一切似乎都很好。除了我的 MySQL 数据库是空的,因为所有数据都在 raid 阵列上。

有没有办法确定 MySQL 是否使用根驱动器路径而不是 raid 阵列?这样我至少知道这个问题是否发生了,所以我可以重新启动 MySQL 来解决这个问题。

foo@foo:~$ lsblk
NAME             MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
loop0              7:0    0 110.6M  1 loop  /snap/core/12834
loop1              7:1    0  27.8M  1 loop  /snap/wifi-ap/355
sda                8:0    0 465.8G  0 disk
└─md0              9:0    0 465.7G  0 raid1 /home/foo/data/database
sdb                8:16   0 465.8G  0 disk
└─md0              9:0    0 465.7G  0 raid1 /home/foo/data/database
sdc                8:32   0  59.6G  0 disk
└─sdc3             8:35   0  59.6G  0 part
  ├─foo_vg-root 253:0    0  16.2G  0 lvm   /
  ├─foo_vg-data 253:1    0  42.5G  0 lvm   /home/foo/data
  └─foo_vg-swap 253:2    0     1G  0 lvm   [SWAP]
foo@foo:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system>         <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/foo-root    /               ext4    errors=remount-ro 0       1
/dev/mapper/foo_vg-data /home/foo/data  ext4    defaults          0       0
/dev/mapper/foo_vg-swap none            swap    sw                0       0

/dev/md0        /home/foo/data/database   ext4  defaults,nofail,discard   0   0
mount mysql
  • 1 个回答
  • 38 Views
Martin Hope
Jeff
Asked: 2022-03-15 15:05:17 +0800 CST

为什么这个 init.d 脚本有时在关机时不运行?

  • 0

我在 Debian 10 Buster 上。

我不知道这个 init.d 脚本有什么问题?有时它不会在服务器关闭时运行。

当error_log服务器因SIGHUP. 这是描述此行为的链接:MySQL Server response to SIGHUP signals

我正在使用的这个 init.d 脚本/etc/init.d/mysql直接取自MySQL 官方发行版 deb,我自己做了一些小的修改,这些修改记录在文件中。

这是init.d 脚本引用的源 mysql-helpers 文件。

在运行时停止/启动/重新启动 MySQL永远不会产生 SIGHUP,但有时脚本会因为没有日志信息而阻塞。.pid 消失了,但 MySQL 默默地无法启动。

令人沮丧的部分是它有时在关机时运行,有时不运行。它是随机的;75% 不运行,25% 运行。

这个问题的另一部分可能是,有谁知道在哪里可以找到 Debian 10 上 MySQL 5.7.37 的有效 init.d 脚本?

debian mysql
  • 1 个回答
  • 264 Views
Martin Hope
Samuel Brown
Asked: 2021-11-11 06:36:28 +0800 CST

将 datadir 行添加到 my.cnf 文件后无法重新启动 MariaDB

  • 0

将以下行添加到 my.cnf 的 [mysqld] 部分后,让 MariaDB 重新启动时出现问题:

datadir = /home/mysql

它不会重新启动。这可能是权限问题。这是保存我所有 SQL 数据的目录。这是 systemctl status mysql.service 显示的内容

● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2021-11-10 08:33:00 CST; 36s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 14438 ExecStart=/usr/lib/mysql/mysql-systemd-helper start (code=exited, status=1/FAILURE)
  Process: 14425 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper upgrade (code=exited, status=0/SUCCESS)
  Process: 14412 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper install (code=exited, status=0/SUCCESS)
 Main PID: 14438 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Nov 10 08:33:00 law-amp3 mysql-systemd-helper[14438]: 2021-11-10  8:33:00 0 [Note] /usr/sbin/mysqld (mysqld 10.4.17-MariaDB-log) starting as process 14438 ...
Nov 10 08:33:00 law-amp3 mysql-systemd-helper[14438]: 2021-11-10  8:33:00 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32214)
Nov 10 08:33:00 law-amp3 mysql-systemd-helper[14438]: 2021-11-10  8:33:00 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
Nov 10 08:33:00 law-amp3 mysql-systemd-helper[14438]: 2021-11-10  8:33:00 0 [Warning] Can't create test file /home/mysql/law-amp3.lower-test
Nov 10 08:33:00 law-amp3 mysql-systemd-helper[14438]: [87B blob data]
Nov 10 08:33:00 law-amp3 mysql-systemd-helper[14438]: 2021-11-10  8:33:00 0 [ERROR] Aborting
Nov 10 08:33:00 law-amp3 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Nov 10 08:33:00 law-amp3 systemd[1]: Failed to start MariaDB database server.
Nov 10 08:33:00 law-amp3 systemd[1]: mariadb.service: Unit entered failed state.
Nov 10 08:33:00 law-amp3 systemd[1]: mariadb.service: Failed with result 'exit-code'.
mysql opensuse
  • 1 个回答
  • 134 Views
Martin Hope
balon
Asked: 2021-11-11 01:11:35 +0800 CST

释放低磁盘 PC 上的 mysql 空间

  • 0

我有一台带小磁盘的 PC:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.5G  3.1G  249M  93% /
devtmpfs        459M     0  459M   0% /dev
tmpfs           463M     0  463M   0% /dev/shm
tmpfs           463M   36M  428M   8% /run
tmpfs           5.0M  8.0K  5.0M   1% /run/lock
tmpfs           463M     0  463M   0% /sys/fs/cgroup
/dev/mmcblk0p1   63M   25M   38M  40% /boot
tmpfs            64M  140K   64M   1% /mnt/ramdisk

我有一个简单的数据库,但其中一个表有超过 500 万行,在这么小的记录上占用了很多:

# ls -lh /var/lib/mysql/datalogger/
total 1.1G
...
-rw-rw---- 1 mysql mysql 1.1G Nov 10 09:56 avg_values.ibd
...

我的目标是在没有占用太多空间的其他类似计算机上完成(大约在该表中的一半)是运行删除超过 6 个月的数据的查询。查询与案例无关。查询后,运行optimize NO_WRITE_TO_BINLOG table avg_values;释放ibd空间。

有问题的计算机的问题是 - 我相信 - 可用空间非常有限,您无法在如此大的表上执行查询(我理解缓存),导致通信不稳定,即使查询有一个限制:

MariaDB [datalogger]> select * from avg_values limit 10;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    5
Current database: datalogger

ERROR 2013 (HY000): Lost connection to MySQL server during query

对于其他较小的表,通常没有问题(尽管它也表示错误):

MariaDB [datalogger]> select * from raw_values;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    5
Current database: datalogger

+----+---------------------+-------------------+------+-------+
| id | timestamp           | channel           | raw  | value |
+----+---------------------+-------------------+------+-------+
|  1 | 2021-11-10 09:46:51 | AI1               |    1 | 0.011 |
|  2 | 2021-11-10 09:46:51 | AI2               |    1 | 0.011 |
|  3 | 2021-11-10 09:46:51 | AI3               |    2 | 0.022 |
|  4 | 2021-11-10 09:46:51 | AI4               |    2 | 0.022 |
|  5 | 2021-11-10 09:46:51 | pyr1_sensor1_data |  113 |   113 |
|  6 | 2021-11-10 09:46:51 | pyr1_body_temp    |   42 |    42 |
|  7 | 2021-11-10 09:46:51 | pyr2_sensor1_data | NULL |  NULL |
|  8 | 2021-11-10 09:46:51 | pyr2_body_temp    | NULL |  NULL |
|  9 | 2021-11-10 09:46:46 | AI1               |    1 | 0.011 |
| 10 | 2021-11-10 09:46:46 | AI2               |    1 | 0.011 |
| 11 | 2021-11-10 09:46:46 | AI3               |    2 | 0.022 |
| 12 | 2021-11-10 09:46:46 | AI4               |    2 | 0.022 |
| 13 | 2021-11-10 09:46:46 | pyr1_sensor1_data |  115 |   115 |
| 14 | 2021-11-10 09:46:46 | pyr1_body_temp    |   42 |    42 |
| 15 | 2021-11-10 09:46:46 | pyr2_sensor1_data | NULL |  NULL |
| 16 | 2021-11-10 09:46:46 | pyr2_body_temp    | NULL |  NULL |
| 17 | 2021-11-10 09:46:52 | AI1               |    1 | 0.011 |
| 18 | 2021-11-10 09:46:52 | AI2               |    1 | 0.011 |
| 19 | 2021-11-10 09:46:52 | AI3               |    2 | 0.022 |
| 20 | 2021-11-10 09:46:52 | AI4               |    2 | 0.022 |
| 21 | 2021-11-10 09:46:52 | pyr1_sensor1_data |  112 |   112 |
| 22 | 2021-11-10 09:46:52 | pyr1_body_temp    |   42 |    42 |
| 23 | 2021-11-10 09:46:52 | pyr2_sensor1_data | NULL |  NULL |
| 24 | 2021-11-10 09:46:52 | pyr2_body_temp    | NULL |  NULL |
+----+---------------------+-------------------+------+-------+
24 rows in set (0.02 sec)

有什么方法可以运行这些查询,尤其是使用这个小磁盘来释放空间?

mysql disk
  • 1 个回答
  • 51 Views
Martin Hope
Anton Hinkel
Asked: 2021-10-31 14:57:35 +0800 CST

datadir 更改后启动 mysql/mariaDB 服务

  • 1

我安装了 mariadb 服务器并使用密码创建了一个 root 用户

sudo apt install mariadb-server
sudo mysql_secure_installation

由于我使用 Rasperri Pi,因此我想将 DB 交换到外部硬盘。为此,我采取了本教程

在我更改了 cnf 文件(都在 /etc/mysql/mariadb.conf/ 下以及 /etc/mysql 下的 debian.cnf 文件)之后,启动 mysql 服务失败:

 $ sudo service mysql start
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

日志说无法创建测试文件:

$systemctl status mariadb.service
Okt 30 22:56:31 raspberrypitouch systemd[1]: Starting MariaDB 10.3.31 database server...
Okt 30 22:56:31 raspberrypitouch mysqld[4694]: 2021-10-30 22:56:31 0 [Note] /usr/sbin/mysqld (mysqld 10.3.31-MariaDB-0+deb10u1) starting as process 4694 ...
Okt 30 22:56:31 raspberrypitouch mysqld[4694]: 2021-10-30 22:56:31 0 [Warning] Can't create test file /media/pi/DBDRIVE/MariaDB/raspberrypitouch.lower-test
Okt 30 22:56:31 raspberrypitouch mysqld[4694]: [101B blob data]
Okt 30 22:56:31 raspberrypitouch mysqld[4694]: 2021-10-30 22:56:31 0 [ERROR] Aborting
Okt 30 22:56:31 raspberrypitouch systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Okt 30 22:56:31 raspberrypitouch systemd[1]: mariadb.service: Failed with result 'exit-code'.
Okt 30 22:56:31 raspberrypitouch systemd[1]: Failed to start MariaDB 10.3.31 database server.

经过广泛搜索,我发现并排除了以下可能的原因:

  1. apparmour和SELinux正在阻止对新目录的访问 -> 它们未安装

    getenforce
    -bash: getenforce: command not found
    

    和

    aa-status
    
    -bash: aa-status: command not found
    
  2. 错字

    我已经复制了所有路径,一个错字将是忙碌两天的一个非常糟糕的理由

  3. 缺少 权限

    我已经复制了这个,所以权限应该是正确的:cp -R -p /var/lib/mysql/* /media/pi/DBDRIVE/MariaDB/

    父文件夹

    /media/pi/DBDRIVE $ ls -l
    total 20
    drwx------ 2 mysql mysql 16384 Oct 29 12:25 lost+found
    drwxrwxrwx 6 mysql mysql  4096 Oct 30 23:07 MariaDB
    

    db 文件夹本身

    /media/pi/DBDRIVE/MariaDB $ ls -l
    
    total 110632
    
    -rw-rw---- 1 mysql mysql    16384 Oct 30 15:30 aria_log.00000001
    -rw-rw---- 1 mysql mysql       52 Oct 30 15:30 aria_log_control
    -rw-r--r-- 1 root  root         0 Oct 30 13:02 debian-10.3.flag
    -rw-rw---- 1 mysql mysql      976 Oct 30 15:30 ib_buffer_pool
    -rw-rw---- 1 mysql mysql 12582912 Oct 30 15:30 ibdata1
    -rw-rw---- 1 mysql mysql 50331648 Oct 30 15:30 ib_logfile0
    -rw-rw---- 1 mysql mysql 50331648 Oct 30 13:02 ib_logfile1
    -rw-rw---- 1 mysql mysql        0 Oct 30 13:02 multi-master.info
    drwx------ 2 mysql mysql     4096 Oct 30 13:02 mysql
    drwxrwxrwx 2 mysql mysql     4096 Oct 30 17:50 mysqld
    drwx------ 2 mysql mysql     4096 Oct 30 13:02 performance_schema
    drwx------ 2 mysql mysql     4096 Oct 30 15:12 testDB
    

    驱动器

    /media/pi/DBDRIVE $ ls -l
    total 20
    drwx------ 2 mysql mysql 16384 Oct 29 12:25 lost+found
    drwxrwxrwx 7 mysql mysql  4096 Oct 30 23:58 MariaDB
    

    圆周率

    /media/pi $ ls -l
    total 4
    drwxr-xr-x 4 mysql mysql 4096 Oct 30 16:53 DBDRIVE
    

    媒体

    /media $ ls -l
    total 4
    drwxr-x---+ 3 root root 4096 Oct 31 01:42 pi
    
  4. 外部驱动器格式错误

    df -Th
    Filesystem     Type      Size  Used Avail Use% Mounted on
    
    /dev/root      ext4       29G  3.8G   25G  14% /
    devtmpfs       devtmpfs  776M     0  776M   0% /dev
    tmpfs          tmpfs     937M     0  937M   0% /dev/shm
    tmpfs          tmpfs     937M  8.6M  928M   1% /run
    tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
    tmpfs          tmpfs     937M     0  937M   0% /sys/fs/cgroup
    /dev/mmcblk0p1 vfat      253M   49M  204M  20% /boot
    tmpfs          tmpfs     188M  4.0K  188M   1% /run/user/1000
    /dev/sda       ext4      916G  186M  870G   1% /media/pi/DBDRIVE
    
  5. cnf 文件中的 错误

    这里基本上是相同的情况,但解决方案对我不起作用

  • 我的.cnf

  • 50-client.cnf

  • 50-mysql-clients.cnf

  • 50-mysqld_safe.cnf

  • 50-server.cnf

  • debian.cnf

正确方向的每一个提示都值得赞赏

为什么我无法启动服务?

mysql mariadb
  • 1 个回答
  • 627 Views
Martin Hope
Tex4066
Asked: 2020-02-15 17:44:40 +0800 CST

RAMDisk 上的 MySQL 未启动

  • 0

我正在尝试将 mysql 程序的所有执行(所有表数据、索引等)移动到 RAM 磁盘上,以进行从常规 SSD 中排除文件 IO 的性能实验。

我开始像往常一样安装 mysql sudo apt install mysql-server:. 程序开始,mysqld我可以正常创建数据库。

我还按照此站点上列出的说明创建了一个 RAMDisk:在该位置的 Ubuntu 上创建 RAMDisk/mnt/ramdisk并使用大小25G(我有64G可用的 RAM)。我可以写入这个位置并观察到我的 RAM 开始按应有的方式填满。

现在,我使用以下命令将我的 mysql 库目录复制到此 RAMDisk:

cp -rp /var/lib/mysql /mnt/ramdisk

并符号链接到它,这样我就不必更改文件datadir中的参数/etc/mysql/mysql.conf.d/mysqld.cnf。

mv mysql _mysql    
ln -s /mnt/ramdisk/mysql mysql

我还更改了权限,以便 MySQL“应该”能够访问 RAMDisk:

root@HOSTNAME:/var/lib# ls -l | grep mysql
lrwxrwxrwx  1 mysql         mysql           19 Feb 14 16:45 mysql -> /mnt/ramdisk/mysql/
drwx------  6 mysql         mysql         4096 Feb 14 17:06 _mysql
drwx------  2 mysql         mysql         4096 Feb 14 12:14 mysql-files
drwx------  2 mysql         mysql         4096 Feb 12 17:14 mysql-keyring
drwxr-xr-x  2 root          root          4096 Jan 21 06:10 mysql-upgrade

和

root@HOSTNAME:/mnt# ls -l
total 0
drwxrwxrwt 3 mysql mysql 60 Feb 14 17:24 ramdisk

root@HOSTNAME:/mnt/ramdisk# ls -l
total 0
drwx------ 5 mysql mysql 380 Feb 14 16:41 mysql

但是,当我现在尝试重新启动mysqld程序时,遇到以下错误:

USER@HOSTNAME:/$ sudo /etc/init.d/mysql restart
[sudo] password for USER: 
[....] Restarting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
 failed!

调查两者systemctl status mysql.service,journalctl -xe并没有对问题提供更多见解:

USER@HOSTNAME:/$ 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 Fri 2020-02-14 17:30:55 PST; 1min 0s ago
  Process: 19794 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)
  Process: 19785 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 17945 (code=exited, status=0/SUCCESS)

Feb 14 17:30:55 HOSTNAME systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Feb 14 17:30:55 HOSTNAME systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
Feb 14 17:30:55 HOSTNAME systemd[1]: Stopped MySQL Community Server.
Feb 14 17:30:55 HOSTNAME systemd[1]: mysql.service: Start request repeated too quickly.
Feb 14 17:30:55 HOSTNAME systemd[1]: mysql.service: Failed with result 'exit-code'.
Feb 14 17:30:55 HOSTNAME systemd[1]: Failed to start MySQL Community Server.

对于journalctl -xe:

-- Unit mysql.service has begun starting up.
Feb 14 17:30:54 HOSTNAME audit[19792]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/mnt/ramdisk/mysql/HOSTNAME.lower-test" pid=19792 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Feb 14 17:30:54 HOSTNAME audit[19792]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/mnt/ramdisk/mysql/HOSTNAME.lower-test" pid=19792 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Feb 14 17:30:54 HOSTNAME audit[19792]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/mnt/ramdisk/mysql/HOSTNAME.lower-test" pid=19792 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Feb 14 17:30:54 HOSTNAME audit[19796]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/mnt/ramdisk/mysql/HOSTNAME.lower-test" pid=19796 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=125 ouid=125
Feb 14 17:30:54 HOSTNAME audit[19796]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/mnt/ramdisk/mysql/HOSTNAME.lower-test" pid=19796 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=125 ouid=125
Feb 14 17:30:54 HOSTNAME audit[19796]: AVC apparmor="DENIED" operation="mknod" profile="/usr/sbin/mysqld" name="/mnt/ramdisk/mysql/HOSTNAME.lower-test" pid=19796 comm="mysqld" requested_mask="c" denied_mask="c" fsuid=125 ouid=125
Feb 14 17:30:54 HOSTNAME audit[19796]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/mnt/ramdisk/mysql/ibdata1" pid=19796 comm="mysqld" requested_mask="wr" denied_mask="wr" fsuid=125 ouid=125
Feb 14 17:30:55 HOSTNAME mysqld[19794]: Initialization of mysqld failed: 0
Feb 14 17:30:55 HOSTNAME systemd[1]: mysql.service: Control process exited, code=exited status=1
Feb 14 17:30:55 HOSTNAME systemd[1]: mysql.service: Failed with result 'exit-code'.
Feb 14 17:30:55 HOSTNAME systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has failed.
ubuntu mysql
  • 1 个回答
  • 109 Views
Martin Hope
ptrcao
Asked: 2019-12-22 20:35:28 +0800 CST

csvsql查询的语法错误?

  • 0

我有一个 csv 文件attributes.csv,我想从中将所有记录检索到一个新文件attributes_withoutPIDate.csv中,不包括Name列以“PI Date”为值的记录。

csvsql以这种方式指挥

csvsql -d ',' -I --query 'select * where Name <> "PI Date" from attributes' attributes.csv > attributes_withoutPIDate.csv

产生错误

(sqlite3.OperationalError) near "from": syntax error
[SQL: select * where Name <> "PI Date" from attributes]
(Background on this error at: http://sqlalche.me/e/e3q8)

我怀疑语法错误。有人可以建议如何解决它吗?

mysql csv
  • 1 个回答
  • 83 Views
Martin Hope
cookie
Asked: 2019-10-10 05:25:20 +0800 CST

错误:'无法通过套接字'/var/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器'

  • 3

我在 Ubuntu 19.04 发行版上运行并且有一个 Dockerfile,当我们到达第 7 步时;

Step 7/11 : RUN (/usr/bin/mysqld_safe &); sleep 5; mysqladmin -u root -proot create wordpress

我们得到;

2019-10-09T12:18:34.365421Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket 
'/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

查看错误消息:mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.

cookie@cookie-K501UX:~/code/docker$ ls -la /var/run/mysqld
total 8
drwxr-xr-x  2 mysql mysql  100 Oct  9 13:10 .
drwxr-xr-x 36 root  root  1060 Oct  9 13:10 ..
-rw-r-----  1 mysql mysql    6 Oct  9 13:10 mysqld.pid
srwxrwxrwx  1 mysql mysql    0 Oct  9 13:10 mysqld.sock
-rw-------  1 mysql mysql    6 Oct  9 13:10 mysqld.sock.lock

确实如此。和Check that mysqld is running

$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-09 13:26:21 BST; 8min ago

这是。如果套接字文件存在并且 MySQL 守护程序正在运行 - 有什么问题?

mysql
  • 2 个回答
  • 1449 Views
Martin Hope
Gryu
Asked: 2019-10-03 05:46:23 +0800 CST

MySql 社区服务器端口更改

  • 0

我已经使用官方文档在 Oracle Linux 7 上安装了 mysql-community-server 8.0

已经安装成功,但是:

# service mysqld start

导致:

Redirecting to /bin/systemctl start mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.


[root@myhost tmp]# journalctl -xe
Oct 02 16:19:29 myhost systemd[1]: Starting MySQL Server...
-- Subject: Unit mysqld.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysqld.service has begun starting up.
Oct 02 16:19:39 myhost systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Oct 02 16:19:39 myhost systemd[1]: Failed to start MySQL Server.
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysqld.service has failed.
-- 
-- The result is failed.
Oct 02 16:19:39 myhost systemd[1]: Unit mysqld.service entered failed state.
Oct 02 16:19:39 myhost systemd[1]: mysqld.service failed.

[root@myhost tmp]# vi /var/log/mysqld.log
2019-10-02T13:19:36.151426Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.17) starting as process 21346
2019-10-02T13:19:38.162471Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2019-10-02T13:19:38.165671Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Address already in use
2019-10-02T13:19:38.165697Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2019-10-02T13:19:38.166475Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-10-02T13:19:38.958654Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.17)  MySQL Community Server - GPL.

[root@myhost tmp]# ps aux | grep mysql
root      2031  0.0  0.0 115388  3108 ?        S    11:59   0:00 /bin/sh /opt/zbox/run/mysql/mysqld_safe --defaults-file=/opt/zbox/etc/mysql/my.cnf
nobody    2487  0.0  0.4 525380 36448 ?        Sl   11:59   0:00 /opt/zbox/run/mysql/mysqld --defaults-file=/opt/zbox/etc/mysql/my.cnf --basedir=/opt/zbox/run/mysql --datadir=/opt/zbox/data/mysql --plugin-dir=/opt/zbox/run/lib/mysql/plugin --user=nobody --log-error=/opt/zbox/logs/mysql_error.log --pid-file=/opt/zbox/tmp/mysql/mysqld.pid --socket=/opt/zbox/tmp/mysql/mysql.sock --port=3306

我发现 mysql-community-server 的配置文件位于 path: /etc/my.cnf. 但它不包含有关端口设置的信息。/etc/my.cnf.d/文件夹为空。

我怎么能改变它的端口?

mysql
  • 1 个回答
  • 219 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve