Azure / CloudShell

Container Image for Azure Cloud Shell (https://azure.microsoft.com/en-us/features/cloud-shell/)
https://shell.azure.com
MIT License
239 stars 101 forks source link

Remove mysqld if the user can't use the tool #435

Open surajssd opened 2 weeks ago

surajssd commented 2 weeks ago

If I were to start mysql today I can't do that in the cloudshell.

For e.g. if I start it by default here is what I see:

suraj [ ~ ]$ mysqld
2024-06-19T01:33:41.892133Z 0 [System] [MY-010116] [Server] /usr/bin/mysqld (mysqld 8.0.35) starting as process 453
2024-06-19T01:33:41.893788Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/usr/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2024-06-19T01:33:41.906049Z 0 [Warning] [MY-010091] [Server] Can't create test file /usr/data/mysqld_tmp_file_case_insensitive_test.lower-test
2024-06-19T01:33:41.906061Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/data/ is case insensitive
2024-06-19T01:33:41.907612Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/usr/data/' (OS errno: 2 - No such file or directory)
2024-06-19T01:33:41.907694Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-06-19T01:33:41.923194Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.35)  Source distribution.

And even when I provide another folder in the home directory, these are the errors I see:

suraj [ ~ ]$ mkdir foo
suraj [ ~ ]$ mysqld --datadir `pwd`/foo
2024-06-19T01:29:25.638349Z 0 [System] [MY-010116] [Server] /usr/bin/mysqld (mysqld 8.0.35) starting as process 6023
2024-06-19T01:29:25.638396Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/usr/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2024-06-19T01:29:25.646704Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5d32b36e-2ddb-11ef-b233-00155de882b9.
2024-06-19T01:29:25.682773Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2024-06-19T01:29:25.683606Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-06-19T01:29:25.683648Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-06-19T01:29:25.684159Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.35)  Source distribution.
surajssd commented 1 week ago

Currently Azure Linux ships a bulky package called mysql which has both mysqld (MySQL server) and the mysql (MySQL client). So I created an issue in the Azure Linux repo to see if we can split the package into mysql-client and mysql-server. I believe that we should keep the mysql client it can be used to connect to mysql servers hosted remotely.