Re: What happened to my /tmp/mysql.sock ?!!??!

From: Aryeh Friedman <aryeh.friedman_at_gmail.com>
Date: Sat, 27 May 2023 17:04:13 UTC
On Sat, May 27, 2023 at 12:59 PM Odhiambo Washington <odhiambo@gmail.com> wrote:
>
>
>
> On Sat, May 27, 2023 at 7:44 PM Aryeh Friedman <aryeh.friedman@gmail.com> wrote:
>>
>> On Sat, May 27, 2023 at 12:22 PM Odhiambo Washington <odhiambo@gmail.com> wrote:
>> >
>> >
>> >
>> > On Sat, May 27, 2023 at 6:51 PM Aryeh Friedman <aryeh.friedman@gmail.com> wrote:
>> >>
>> >> I accidentally erased the above file and now no matter what I try
>> >> (even a complete fresh install of the OS!?!?!) I can not get it made..
>> >> It appears it comes prebroken actually due to manually attempt to
>> >> start the service
>> >>
>> >> So the question is how on earth do I make this file... spent a while
>> >> searching the web and fighting with chatGPT to no avail.
>> >
>> >
>> > That file is created automatically when MySQL is started. It is a Unix socket.
>> > You do not need a complete reinstall of the OS to solve this problem.
>> > Just find out what is stopping MySQL service from starting.
>> > You do not even need to reinstall MySQL!
>>
>> root@sarek1024:~ # ls /tmp/m*
>> ls: No match.
>> root@sarek1024:~ # service mysql-server onestart
>> // modified rc.d file to echo command as well as do it
>> /usr/local/bin/mysqld_safe --initialize
>> --defaults-extra-file=/usr/local/etc/mysql/my.cnf --basedir=/usr/local
>> --datadir=/var/db/mysql --mysqld-file=/usr/local/libexec/mysqld
>> --user=mysql
>> Starting mysql.
>> root@sarek1024:~ # !ls
>> ls /tmp/m*
>> ls: No match.
>> root@sarek1024:~ # mysql
>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
>> '/tmp/mysql.sock' (2)
>> root@sarek1024:~ # tail -20 /var/log/messages
>> May 27 05:32:01 sarek1024 pkg-static[82552]: libXScrnSaver-1.2.4 installed
>> May 27 05:32:09 sarek1024 pkg-static[88080]: tk86-8.6.13 installed
>> May 27 05:34:47 sarek1024 pkg-static[99500]: shc-4.0.3 installed
>> May 27 05:34:48 sarek1024 pkg-static[99839]: tk-wrapper-1.1_3 installed
>> May 27 05:34:48 sarek1024 pkg-static[99963]: tkdiff-5.0 installed
>> May 27 05:34:48 sarek1024 pkg-static[160]: aegis-4.25_14 installed
>> May 27 05:35:00 sarek1024 pkg-static[5372]: gsed-4.9 installed
>> May 27 05:35:59 sarek1024 pkg-static[81263]: lsof-4.97.0,8 installed
>> May 27 05:36:00 sarek1024 pkg-static[81390]: libexplain-1.3.D012_6 installed
>> May 27 05:36:04 sarek1024 pkg-static[83063]: fhist-1.21_6 installed
>> May 27 05:36:23 sarek1024 pkg-static[86662]: cook-2.30_3 installed
>> May 27 05:36:24 sarek1024 pkg-static[87421]: log4j-1.2.17 installed
>> May 27 05:36:24 sarek1024 pkg-static[87556]:
>> mysql-connector-java51-5.1.49 installed
>> May 27 07:18:39 sarek1024 su[87745]: aryeh to root on /dev/pts/0
>> May 27 07:20:44 sarek1024 aryeh[88442]:
>> /usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for
>> mysql
>> May 27 07:22:38 sarek1024 aryeh[88484]:
>> /usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for
>> mysql
>> May 27 07:27:13 sarek1024 aryeh[88574]:
>> /usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for
>> mysql
>> May 27 07:33:42 sarek1024 aryeh[89279]:
>> /usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for
>> mysql
>> May 27 07:34:42 sarek1024 aryeh[89290]:
>> /usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for
>> mysql
>> May 27 07:35:28 sarek1024 aryeh[89303]:
>> /usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for
>>
>> mysql
>
>
> cd  /var/db/mysql/
>
> less FQDN.err (FQDN = Fully Qualified Domain Name)
> That file will tell you why msql is not able to start.

No errors I can see

2023-05-27T11:38:45.6NZ mysqld_safe mysqld from pid file
/var/db/mysql/sarek1024.pid ended
2023-05-27T12:40:12.6NZ mysqld_safe Logging to '/var/db/mysql/sarek1024.err'.
2023-05-27T12:40:12.6NZ mysqld_safe Starting mysqld daemon with
databases from /var/db/mysql
2023-05-27T12:40:12.615584Z 0 [Note] /usr/local/libexec/mysqld (mysqld
5.7.41-log) starting as process 96819 ...
2023-05-27T12:40:12.635072Z 0 [Note] InnoDB: Mutexes and rw_locks use
GCC atomic builtins
2023-05-27T12:40:12.635084Z 0 [Note] InnoDB: Uses event mutexes
2023-05-27T12:40:12.635086Z 0 [Note] InnoDB: GCC builtin
__atomic_thread_fence() is used for memory barrier
2023-05-27T12:40:12.635089Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.13
2023-05-27T12:40:12.635228Z 0 [Note] InnoDB: Number of pools: 1
2023-05-27T12:40:12.635274Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-05-27T12:40:12.636011Z 0 [Note] InnoDB: Initializing buffer pool,
total size = 1G, instances = 8, chunk size = 128M
2023-05-27T12:40:12.688662Z 0 [Note] InnoDB: Completed initialization
of buffer pool
2023-05-27T12:40:12.711899Z 0 [Note] InnoDB: Highest supported file
format is Barracuda.
2023-05-27T12:40:12.728870Z 0 [Note] InnoDB: Creating shared
tablespace for temporary tables
2023-05-27T12:40:12.728995Z 0 [Note] InnoDB: Setting file
'/var/db/mysql/ibtmp1' size to 128 MB. Physically writing the file
full; Please wait ...
2023-05-27T12:40:12.729228Z 0 [Note] InnoDB: Progress in MB:
 100
2023-05-27T12:40:12.772954Z 0 [Note] InnoDB: File
'/var/db/mysql/ibtmp1' size is now 128 MB.
2023-05-27T12:40:12.773348Z 0 [Note] InnoDB: 96 redo rollback
segment(s) found. 96 redo rollback segment(s) are active.
2023-05-27T12:40:12.773353Z 0 [Note] InnoDB: 32 non-redo rollback
segment(s) are active.
2023-05-27T12:40:12.773604Z 0 [Note] InnoDB: Waiting for purge to start
2023-05-27T12:40:12.830802Z 0 [Note] InnoDB: 5.7.41 started; log
sequence number 1209980
2023-05-27T12:40:12.830904Z 0 [Note] InnoDB: Loading buffer pool(s)
from /var/db/mysql/ib_buffer_pool
2023-05-27T12:40:12.831030Z 0 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Table 'mysql.plugin' doesn't exist
2023-05-27T12:40:12.831106Z 0 [ERROR] Can't open the mysql.plugin
table. Please run mysql_upgrade to create it.
2023-05-27T12:40:12.831569Z 0 [Note] InnoDB: Buffer pool(s) load
completed at 230527  8:40:12
2023-05-27T12:40:12.832938Z 0 [Warning] Gtid table is not ready to be
used. Table 'mysql.gtid_executed' cannot be opened.
2023-05-27T12:40:12.833982Z 0 [Note] Found ca.pem, server-cert.pem and
server-key.pem in data directory. Trying to enable SSL support using
them.
2023-05-27T12:40:12.833987Z 0 [Note] Skipping generation of SSL
certificates as certificate files are present in data directory.
2023-05-27T12:40:12.833990Z 0 [Warning] A deprecated TLS version TLSv1
is enabled. Please use TLSv1.2 or higher.
2023-05-27T12:40:12.833992Z 0 [Warning] A deprecated TLS version
TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-05-27T12:40:12.834626Z 0 [Warning] CA certificate ca.pem is self signed.
2023-05-27T12:40:12.834660Z 0 [Note] Skipping generation of RSA key
pair as key files are present in data directory.
2023-05-27T12:40:12.834840Z 0 [Note] Server hostname (bind-address):
'127.0.0.1'; port: 3306
2023-05-27T12:40:12.834856Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2023-05-27T12:40:12.834878Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2023-05-27T12:40:12.835587Z 0 [Warning] Failed to open optimizer cost
constant tables

2023-05-27T12:40:12.835631Z 0 [ERROR] Fatal error: Can't open and lock
privilege tables: Table 'mysql.user' doesn't exist
2023-05-27T12:40:12.835637Z 0 [ERROR] Fatal error: Failed to
initialize ACL/grant/time zones structures or failed to remove
temporary table files.
2023-05-27T12:40:12.835752Z 0 [ERROR] Aborting

2023-05-27T12:40:12.835775Z 0 [Note] Binlog end
2023-05-27T12:40:12.835849Z 0 [Note] Shutting down plugin 'ngram'
2023-05-27T12:40:12.835852Z 0 [Note] Shutting down plugin 'partition'
2023-05-27T12:40:12.835854Z 0 [Note] Shutting down plugin 'BLACKHOLE'
2023-05-27T12:40:12.835855Z 0 [Note] Shutting down plugin 'ARCHIVE'
2023-05-27T12:40:12.835856Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2023-05-27T12:40:12.835881Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
2023-05-27T12:40:12.835883Z 0 [Note] Shutting down plugin 'MyISAM'
2023-05-27T12:40:12.835887Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
2023-05-27T12:40:12.835889Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2023-05-27T12:40:12.835890Z 0 [Note] Shutting down plugin
'INNODB_SYS_TABLESPACES'
2023-05-27T12:40:12.835891Z 0 [Note] Shutting down plugin
'INNODB_SYS_FOREIGN_COLS'
2023-05-27T12:40:12.835892Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2023-05-27T12:40:12.835894Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2023-05-27T12:40:12.835895Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2023-05-27T12:40:12.835896Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2023-05-27T12:40:12.835897Z 0 [Note] Shutting down plugin
'INNODB_SYS_TABLESTATS'
2023-05-27T12:40:12.835899Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2023-05-27T12:40:12.835900Z 0 [Note] Shutting down plugin
'INNODB_FT_INDEX_TABLE'
2023-05-27T12:40:12.835901Z 0 [Note] Shutting down plugin
'INNODB_FT_INDEX_CACHE'
2023-05-27T12:40:12.835902Z 0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2023-05-27T12:40:12.835904Z 0 [Note] Shutting down plugin
'INNODB_FT_BEING_DELETED'
2023-05-27T12:40:12.835905Z 0 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2023-05-27T12:40:12.835906Z 0 [Note] Shutting down plugin
'INNODB_FT_DEFAULT_STOPWORD'
2023-05-27T12:40:12.835907Z 0 [Note] Shutting down plugin 'INNODB_METRICS'
2023-05-27T12:40:12.835909Z 0 [Note] Shutting down plugin
'INNODB_TEMP_TABLE_INFO'
2023-05-27T12:40:12.835910Z 0 [Note] Shutting down plugin
'INNODB_BUFFER_POOL_STATS'
2023-05-27T12:40:12.835911Z 0 [Note] Shutting down plugin
'INNODB_BUFFER_PAGE_LRU'
2023-05-27T12:40:12.835912Z 0 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2023-05-27T12:40:12.835913Z 0 [Note] Shutting down plugin
'INNODB_CMP_PER_INDEX_RESET'
2023-05-27T12:40:12.835915Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2023-05-27T12:40:12.835916Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2023-05-27T12:40:12.835917Z 0 [Note] Shutting down plugin 'INNODB_CMPMEM'
2023-05-27T12:40:12.835918Z 0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2023-05-27T12:40:12.835920Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2023-05-27T12:40:12.835921Z 0 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2023-05-27T12:40:12.835922Z 0 [Note] Shutting down plugin 'INNODB_LOCKS'
2023-05-27T12:40:12.835923Z 0 [Note] Shutting down plugin 'INNODB_TRX'
2023-05-27T12:40:12.835925Z 0 [Note] Shutting down plugin 'InnoDB'
2023-05-27T12:40:12.835975Z 0 [Note] InnoDB: FTS optimize thread exiting.
2023-05-27T12:40:12.836025Z 0 [Note] InnoDB: Starting shutdown...
2023-05-27T12:40:12.938988Z 0 [Note] InnoDB: Dumping buffer pool(s) to
/var/db/mysql/ib_buffer_pool
2023-05-27T12:40:12.972821Z 0 [Note] InnoDB: Buffer pool(s) dump
completed at 230527  8:40:12
2023-05-27T12:40:14.373206Z 0 [Note] InnoDB: Shutdown completed; log
sequence number 1209999
2023-05-27T12:40:14.374428Z 0 [Note] InnoDB: Removed temporary
tablespace data file: "ibtmp1"
2023-05-27T12:40:14.374445Z 0 [Note] Shutting down plugin 'MEMORY'
2023-05-27T12:40:14.374449Z 0 [Note] Shutting down plugin 'CSV'
2023-05-27T12:40:14.374452Z 0 [Note] Shutting down plugin 'sha256_password'
2023-05-27T12:40:14.374454Z 0 [Note] Shutting down plugin
'mysql_native_password'
2023-05-27T12:40:14.374562Z 0 [Note] Shutting down plugin 'binlog'
2023-05-27T12:40:14.375213Z 0 [Note] /usr/local/libexec/mysqld:
Shutdown complete

2023-05-27T12:40:14.6NZ mysqld_safe mysqld from pid file
/var/db/mysql/sarek1024.pid ended

>
> PS: If this is a new machine, then:
>
> rm -rf /var/db/mysql
>
> Then try starting MySQL service again.
> Check if the directory is recreated and read the contents of the file with .err extension.
>
> --
> Best regards,
> Odhiambo WASHINGTON,
> Nairobi,KE
> +254 7 3200 0004/+254 7 2274 3223
> "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
> [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]



-- 
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org