Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

575
Views
MySQL no se iniciará - error: su: advertencia: no se puede cambiar el directorio a /inexistente: No existe tal archivo o directorio

Nuevo en desarrollo y autoaprendizaje (gracias Covid), así que esto podría ser descuidado :( lo siento...

permítanme comenzar diciendo que no me importan los datos en la base de datos; si es más fácil borrarlos y comenzar de nuevo, estoy bien con eso (no sé cómo hacerlo, pero estoy bien con eso)

No estoy seguro de qué causó el problema, pero un día MySQL no se inició. El uso del servicio MySQL Restart lo arregló... dos días después volvió a suceder con este error

 sarcasticsnark@LB-HP-LT:~/Projects/FMS$ sudo service mysql start * Starting MySQL database server mysqld su: warning: cannot change directory to /nonexistent: No such file or directory

He probado un poco de "soluciones"

  1. He intentado reiniciar MySQL

  2. Me di permisos de archivo para los archivos mysql (luego intenté revertir eso)

  3. Moví el directorio MySQL (luego lo invertí, de ahí la copia de la carpeta "mysql" llamada "mysql2" a continuación)

Mis archivos ahora se ven así y no estoy seguro de haber obtenido los permisos del todo bien.

 sarcasticsnark@LB-HP-LT:/var/lib$ ls AccountsService command-not-found fwupd logrotate mysql mysql2, private systemd ucf usbutils PackageKit dbus git man-db mysql-files pam python tpm unattended-upgrades vim apt dhcp initramfs-tools mecab mysql-keyring plymouth snapd ubuntu-advantage update-manager boltd dpkg landscape misc mysql-upgrade polkit-1 sudo ubuntu-release-upgrader update-notifier sarcasticsnark@LB-HP-LT:/var/lib$ cd mysql sarcasticsnark@LB-HP-LT:/var/lib/mysql$ ls '#ib_16384_0.dblwr' TestingGround_development binlog.000009 binlog.000013 binlog.000017 client-cert.pem mysql.ibd server-cert.pem undo_002 '#ib_16384_1.dblwr' TestingGround_test binlog.000010 binlog.000014 binlog.index client-key.pem performance_schema server-key.pem '#innodb_temp' auto.cnf binlog.000011 binlog.000015 ca-key.pem debian-5.7.flag private_key.pem sys FMS_development binlog.000008 binlog.000012 binlog.000016 ca.pem mysql public_key.pem undo_001
  1. He reinicializado MySQL (cuando no se ejecuta sudoku, se produce el siguiente error)
 2020-07-20T02:29:41.520132Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 4096 (requested 8161) 2020-07-20T02:29:41.520141Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 1967 (requested 4000) 2020-07-20T02:29:41.520561Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) initializing of server in progress as process 2570 2020-07-20T02:29:41.522888Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2020-07-20T02:29:41.522921Z 0 [ERROR] [MY-010187] [Server] Could not open file '/var/log/mysql/error.log' for error logging: Permission denied 2020-07-20T02:29:41.523139Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it. 2020-07-20T02:29:41.523187Z 0 [ERROR] [MY-010119] [Server] Aborting 2020-07-20T02:29:41.523313Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.20-0ubuntu0.20.04.1) (Ubuntu).

/var/log/mysql: existe y los permisos para ello son:

 -rw-r----- 1 mysql adm 62273 Jul 19 19:36 error.log

Aquí está mysql/error.log

 2020-07-20T01:50:07.952988Z mysqld_safe Logging to '/var/log/mysql/error.log'. 2020-07-20T01:50:07.986416Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 2020-07-20T01:50:08.000603Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 1024 (requested 8161) 2020-07-20T01:50:08.000610Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 431 (requested 4000) 2020-07-20T01:50:08.262922Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.20-0ubuntu0.20.04.1) starting as process 1608 2020-07-20T01:50:08.281623Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2020-07-20T01:50:08.322464Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation. 2020-07-20T01:50:08.322818Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified. 2020-07-20T01:50:08.322947Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them. 2020-07-20T01:50:08.323017Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation 2020-07-20T01:50:08.323105Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation. 2020-07-20T01:50:08.972320Z mysqld_safe mysqld from pid file /var/lib/mysql/LB-HP-LT.pid ended

Y los permisos para /var/lib/mysql

 sarcasticsnark@LB-HP-LT:/var/lib/mysql$ cd /var/lib sarcasticsnark@LB-HP-LT:/var/lib$ sudo ls -l mysql [sudo] password for sarcasticsnark: total 58048 -rw-r----- 1 mysql mysql 196608 Jul 19 16:34 '#ib_16384_0.dblwr' -rw-r----- 1 mysql mysql 8585216 Jul 11 22:54 '#ib_16384_1.dblwr' drwxr-x--- 2 mysql mysql 4096 Jul 19 16:35 '#innodb_temp' drwxr-x--- 2 mysql mysql 4096 Jul 15 18:06 FMS_development drwxr-x--- 2 mysql mysql 4096 Jun 20 09:04 TestingGround_development drwxr-x--- 2 mysql mysql 4096 Jun 22 20:07 TestingGround_test -rw-r----- 1 mysql mysql 56 Jun 10 17:43 auto.cnf -rw-r----- 1 mysql mysql 210461 Jul 15 17:01 binlog.000008 -rw-r----- 1 mysql mysql 179 Jul 15 17:30 binlog.000009 -rw-r----- 1 mysql mysql 156 Jul 15 17:43 binlog.000010 -rw-r----- 1 mysql mysql 2798 Jul 19 15:55 binlog.000011 -rw-r----- 1 mysql mysql 179 Jul 19 15:56 binlog.000012 -rw-r----- 1 mysql mysql 179 Jul 19 16:11 binlog.000013 -rw-r----- 1 mysql mysql 179 Jul 19 16:25 binlog.000014 -rw-r----- 1 mysql mysql 179 Jul 19 16:27 binlog.000015 -rw-r----- 1 mysql mysql 179 Jul 19 16:27 binlog.000016 -rw-r----- 1 mysql mysql 179 Jul 19 16:34 binlog.000017 -rw-r----- 1 mysql mysql 160 Jul 19 16:27 binlog.index -rw------- 1 mysql mysql 1680 Jun 10 17:43 ca-key.pem -rw-r--r-- 1 mysql mysql 1112 Jun 10 17:43 ca.pem -rw-r--r-- 1 mysql mysql 1112 Jun 10 17:43 client-cert.pem -rw------- 1 mysql mysql 1680 Jun 10 17:43 client-key.pem -rw-r--r-- 1 mysql mysql 0 Jun 12 15:54 debian-5.7.flag drwxr-xr-x 2 mysql mysql 4096 Jun 10 17:43 mysql -rw-r----- 1 mysql mysql 25165824 Jul 19 16:28 mysql.ibd drwxr-x--- 2 mysql mysql 4096 Jun 10 17:43 performance_schema -rw------- 1 mysql mysql 1680 Jun 10 17:43 private_key.pem -rw-r--r-- 1 mysql mysql 452 Jun 10 17:43 public_key.pem -rw-r--r-- 1 mysql mysql 1112 Jun 10 17:43 server-cert.pem -rw------- 1 mysql mysql 1676 Jun 10 17:43 server-key.pem drwxr-x--- 2 mysql mysql 4096 Jun 10 17:43 sys -rw-r----- 1 mysql mysql 12582912 Jul 19 16:34 undo_001 -rw-r----- 1 mysql mysql 12582912 Jul 19 16:34 undo_002
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

El usuario de mysql está buscando un directorio de inicio , que parece no haber sido asignado. Para hacer eso, puedes ejecutar:

 sudo systemctl stop mysql.service sudo usermod -d /var/lib/mysql/ mysql sudo systemctl start mysql.service

o

 sudo service mysql stop sudo usermod -d /var/lib/mysql/ mysql sudo service mysql start

Basado en una respuesta encontrada aquí

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!