Sample Header Ad - 728x90

Database Administrators

Q&A for database professionals who wish to improve their database skills

Latest Questions

2 votes
2 answers
2002 views
What is causing my ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)?
I'm using `brew install mysql`/`brew install mariadb`, and cannot find a way around the following error: `ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)` Here are the key takeaways: * I have nothing running on ports 80, 8080, 3306, etc. * `brew services list`...
I'm using brew install mysql/brew install mariadb, and cannot find a way around the following error: ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2) Here are the key takeaways: * I have nothing running on ports 80, 8080, 3306, etc. * brew services list shows mysql/mariadb as stopped, regardless of how I start it up. * I've looked at permission settings using sudo chown -R mysql:mysql /opt/homebrew/var/mysql and sudo chown -R mysql:mysql /opt/homebrew/var/mysql. * There are no set flags when running ls -lO /opt/homebrew/var/mysql or ls -l0 /opt/homebrew/bin/mariadb * My default my.cnf file (as per Homebrew's installation) is tiny. It only contains a bind-address and a mysqlx-bind-address – both 127.0.0.1. * I cannot find a /tmp/mysql.sock file anywhere, and know it's not enough to simply create one. * Installing MySQL through the DMG actually works, although I need to use MariaDB primarily and that is only available through brew. I've looked at other questions here to try and find an answer. I've gone through solutions relating to [macOS root passwords](https://stackoverflow.com/questions/9695362/macosx-homebrew-mysql-root-password/) , [access denied issues](https://stackoverflow.com/questions/4359131/brew-install-mysql-on-macos?rq=2) with brew installs, tried the solutions in an [answer on ServerFault](https://serverfault.com/questions/279366/what-should-mysqld-sock-contain-why-dont-i-have-it) , and many of the [other top answers](https://serverfault.com/search?q=ERROR+2002+%28HY000%29%3A+Can%27t+connect+to+local+server+through+socket+%27%2Ftmp%2Fmysql.sock%27+%282%29) on this issue over at ServerFault. What else could I look into to fix this? Could there be a more complex permissions issue, and if so, how do I go about diagnosing it? I'll of course add further details here if requested, so please let me know what you'd want to see. **UPDATE 10-Apr** After looking at my .err logs, it appears as though I have some data corruption in the ibdata1 table:
2024-04-10T22:19:41.436840Z 1 [ERROR] [MY-012224] [InnoDB] Tablespace flags are invalid in datafile: ./ibdata1, Space ID:0, Flags: 21. Please refer to http://dev.mysql.com/doc/refman/8.3/en/innodb-troubleshooting-datadict.html  for how to resolve the issue.
2024-04-10T22:19:41.436882Z 1 [ERROR] [MY-012237] [InnoDB] Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2024-04-10T22:19:41.436891Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Data structure corruption.
2024-04-10T22:19:41.438452Z 1 [ERROR] [MY-011013] [Server] Failed to initialize DD Storage Engine.
2024-04-10T22:19:41.438575Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-04-10T22:19:41.438583Z 0 [ERROR] [MY-010119] [Server] Aborting
To try and get round this, I've looked to use innodb_force_recovery = 1 in my.cnf, and went up to 6. mariadb-safe --skip-grant-tables hasn't fixed anything either. Running brew services start -v mariadb gives me the following:
/bin/launchctl enable gui/501/homebrew.mxcl.mariadb
/bin/launchctl bootstrap gui/501 /Users//Library/LaunchAgents/homebrew.mxcl.mariadb.plist
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users//Library/LaunchAgents/homebrew.mxcl.mariadb.plist exited with 5.
However, I don't have a storage issue, nor does my hard drive seem to have any issues. **UPDATE 11-Apr** I had already checked this, but wanted to recheck permissions and for flags on /opt/homebrew/var/mysql and /opt/homebrew/bin/mariadb as detailed in the takeaways list. Here's what I've done: * Ran dscl . -list /Groups and confirmed there is the _mysql group. * Ran id mysql and confirmed it's a member of the _mysql group (uid=74(_mysql) gid=74(_mysql)) * Ran ls -lO /opt/homebrew/bin/mariadb to check the permissions for mysql:mysql and username:admin (755 lrwxr-xr-x) * Ran ls -lO /opt/homebrew/var/mysql to check the permissions for mysql:mysql and username:admin (700 drwx------) I've also reconfirmed solutions I'd already come across and discarded: * Removing mysqlx-bind-address = 127.0.0.1 from my.cnf (and the various other solutions) based on this question .
It's WPTom (29 rep)
Apr 10, 2024, 10:21 PM • Last activity: Apr 11, 2025, 01:09 PM
0 votes
1 answers
3323 views
mysql on Mac Monterey not working regardless what I do
I am running a Mac on Monterey v 12.4 with an M1 Max. I tried to install mysql on my Mac but I never get it to work regardless what I do. The first thing I tried to do is: ``` $ brew install mysql ``` Then I start the server: ``` $ brew services start mysql ==> Successfully started `mysql` (label: h...
I am running a Mac on Monterey v 12.4 with an M1 Max. I tried to install mysql on my Mac but I never get it to work regardless what I do. The first thing I tried to do is:
$ brew install mysql
Then I start the server:
$ brew services start mysql
==> Successfully started mysql (label: homebrew.mxcl.mysql)
But when I try to execute the following command or **any other mysql cli command**:
$ mysql_secure_installation
I always get the following error: > Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) I've tried every possible fix I could find on the internet but nothing works. I then tried to install the community server from the mysql website. It shows me in the settings it it's running properly, but I can't connect to the Server. Neither using the workbench nor the cli. So I removed it again. I also did brew doctor and fixed the issues. I am really desperate to get the mysql server running for local programming and would appreciate any help! Thanks in advance!
Alex
Jul 14, 2022, 08:35 AM • Last activity: Mar 5, 2025, 02:09 AM
4 votes
1 answers
684 views
Brew Upgrade Mysql: sdi_delete failed: Record Doesn't exist: tablespace_id: 1 Key: 1 4049
I ran the following commands from the cli in MacOS Monterey V 12.4: ``` brew update brew upgrade ``` Upon doing so, MySQL was upgraded from 8.0.30 to 8.0.31. MySQL was running in the background during the upgrade. MySql would not restart, so I rebooted the Mac as a first attempt to solve the issue....
I ran the following commands from the cli in MacOS Monterey V 12.4:
brew update 
brew upgrade
Upon doing so, MySQL was upgraded from 8.0.30 to 8.0.31. MySQL was running in the background during the upgrade. MySql would not restart, so I rebooted the Mac as a first attempt to solve the issue. When I run
restart
I get the following list of messages:
2022-12-05T18:28:17.528347Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/8.0.31/bin/mysqld (mysqld 8.0.31) starting as process 19796
2022-12-05T18:28:17.530983Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2022-12-05T18:28:17.536857Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-12-05T18:28:17.756641Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-12-05T18:28:18.381834Z 4 [System] [MY-013381] [Server] Server upgrade from '80030' to '80031' started.
2022-12-05T18:28:29.775399Z 4 [Warning] [MY-011836] [InnoDB] sdi_delete failed: Record Doesn't exist: tablespace_id: 1 Key: 1 4049
2022-12-05T18:28:29.796888Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Copyright (c) 2018, 2022, Oracle and/or its affiliates. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- -- Alters the sys_config table for upgrades -- ALTER TABLE sys_config CHARACTER SET utf8mb4; ' failed with error code = 3958, error message = 'Failed to delete sdi for sys.sys_config in sys/sys_config due to missing record.'.
2022-12-05T18:28:29.798728Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2022-12-05T18:28:29.798742Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-12-05T18:28:30.135378Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.31/bin/mysqld: Shutdown complete (mysqld 8.0.31)  Homebrew.
There are a few StackOverflow questions regarding the error sdi_delete failed: Record Doesn't exist: tablespace_id: 1 Key: 1 4049, but they all seem to be related to an attempted SQL command that is performed while the server is actually running.
The data directory
/usr/local/var/mysql
contains the following files:
#ib_16384_0.dblwr       ca-key.pem              private_key.pem
#ib_16384_1.dblwr       ca.pem                  public_key.pem
#innodb_redo            client-cert.pem         mysql               server-cert.pem
#innodb_temp            client-key.pem          mysql.ibd           server-key.pem
My-Mac.local.err        mysql_upgrade_info      ib_buffer_pool      sys
auto.cnf                ibdata1                 undo_001            undo_002
binlog.index            localhost.err           performance_schema
plus all the database names/data that I did not include in the list above. I have created a backup of the mysql directory and tried deleting the mysql_upgrade_info file, and the #innodb_redo directory, but that didn't help resolve the problem. What might I do to get the mysql server past the sdi_delete error so the upgrade will complete and the server will start?
Derrick (141 rep)
Dec 11, 2022, 03:34 AM • Last activity: Mar 4, 2025, 02:01 AM
0 votes
0 answers
27 views
InnoDB issues with MySQL installed with homebrew
I installed MySQL with Homebrew and I think it was version 5.7 or earlier version at the end of 2022. `mysql.server start` used to work fine until recent months. My current mysql is of `Ver 9.1.0 for macos14.7 on x86_64 (Homebrew)`. I can still see the `.ibd` files with my table names in `/usr/local...
I installed MySQL with Homebrew and I think it was version 5.7 or earlier version at the end of 2022. mysql.server start used to work fine until recent months. My current mysql is of Ver 9.1.0 for macos14.7 on x86_64 (Homebrew). I can still see the .ibd files with my table names in /usr/local/var/mysql. But when I run mysql.server start, there is this error:
Starting MySQL
..... ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook-Pro-2.local.pid).
And /usr/local/var/mysql/MacBook-Pro-2.local.err shows:
2025-01-02T13:12:48.6NZ mysqld_safe Logging to '/usr/local/var/mysql/MacBook-Pro-2.local.err'.
2025-01-02T13:12:48.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2025-01-02T13:12:48.235894Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2025-01-02T13:12:48.416439Z 0 [System] [MY-010116] [Server] /usr/local/Cellar/mysql/9.1.0/bin/mysqld (mysqld 9.1.0) starting as process 2590
2025-01-02T13:12:48.418974Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2025-01-02T13:12:48.427614Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-01-02T13:12:48.574683Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2025-01-02T13:12:48.574725Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2025-01-02T13:12:48.574738Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2025-01-02T13:12:48.574770Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2025-01-02T13:12:48.574779Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2025-01-02T13:12:48.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/MacBook-Pro-2.local.pid ended
Somehow I tried installing different versions of mysql in Homebrew and tried moving the data out of /usr/local/var/mysql and run mysqld --initialize --user=$(whoami) --datadir=/usr/local/var/mysql. But nothing really worked. I moved all the files back to /usr/local/var/mysql. How can I make mysql.server start work again? At least, can I restore my data?
Paul Chuang (101 rep)
Jan 3, 2025, 01:23 AM
0 votes
0 answers
104 views
Upgrading database instance for MongoDB 4.2 to 4.4 requires legacy MongoDB on Macosx
I'm running MongoDB within a ten year old node app, and in the process of upgrading node had to upgrade MongoDB. For some time, I have been using MongoDB community 4.4 to run the database, but in the process of upgrading to MongoDB community 7 (the latest) I got this error in the output log when I t...
I'm running MongoDB within a ten year old node app, and in the process of upgrading node had to upgrade MongoDB. For some time, I have been using MongoDB community 4.4 to run the database, but in the process of upgrading to MongoDB community 7 (the latest) I got this error in the output log when I tried to run mongod through "brew services restart mongodb/brew/mongodb-community@4.4:" > "This version of MongoDB is too recent to start up on the existing data files. Try MongoDB 4.2 or earlier." I have reinstalled 4.4: the newly installed version gives this error and fails, but the older 4.4 actually worked. (Curiously -- trying to run mongodb/brew/mongodb-community I get no error messages at all, no output to the log file, but nothing works). Several questions: 1. Why does 4.4 not work now, when it did earlier? It appears I now have 4.4.29, as a result of the reinstallation. How can I go back to an earlier version? 2. Why does mongodb/brew/mongodb-community give no output to the logfile, appears to succeed but actually fails? 3. Is there a way of loading and running 4.2? Brew does not support anything before 4.4, it seems. Nor does there seem to be any way of installing and running mongodb 4.2 from the mongo site.
peter (101 rep)
Aug 26, 2024, 07:55 AM • Last activity: Aug 26, 2024, 12:20 PM
0 votes
2 answers
2632 views
How to install sqlplus in macOS M1 Pro ( silicon chip)
I have been searching in internet for best way to install sqlplus in MacOs apple silicon chip ( arm bases processor). please guide me some easiest method to do that. I saw that many article about installing sqlplus in x64 intel based processor but not for the arm64 based processor. Some more details...
I have been searching in internet for best way to install sqlplus in MacOs apple silicon chip ( arm bases processor). please guide me some easiest method to do that. I saw that many article about installing sqlplus in x64 intel based processor but not for the arm64 based processor. Some more details about the system Chip Apple M1 Pro Mac OS version Mac OS Sonoma 14.3.1
Developer
Mar 19, 2024, 05:25 AM • Last activity: Jun 22, 2024, 04:04 PM
0 votes
1 answers
128 views
Removing mongoDB from MacOS
I need to delete all mongoDB thing in my mac. i followed the uninstall guide on [mongoDB uninstall official guide](https://www.mongodb.com/resources/products/fundamentals/uninstall-mongodb) but on step **2** which is `launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist rm -...
I need to delete all mongoDB thing in my mac. i followed the uninstall guide on [mongoDB uninstall official guide](https://www.mongodb.com/resources/products/fundamentals/uninstall-mongodb) but on step **2** which is `launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist rm -f ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist launchctl remove homebrew.mxcl.mongodb-community` i got this error: `Unload failed: 5: Input/output error Try running "launchctl bootout" as root for richer errors. `
antisuri (1 rep)
Jun 17, 2024, 04:48 PM • Last activity: Jun 18, 2024, 01:05 AM
1 votes
1 answers
1033 views
MySQL Plugin "mysql_old_password" not loaded
In an attempt to fix another issue I had, I ran the commands below (as per https://dev.mysql.com/doc/refman/5.6/en/old-client.html) ```sql mysql> UPDATE mysql.user SET plugin = 'mysql_old_password' mysql> WHERE User = 'root' AND Host = 'localhost'; mysql> FLUSH PRIVILEGES; mysql> SET PASSWORD FOR ->...
In an attempt to fix another issue I had, I ran the commands below (as per https://dev.mysql.com/doc/refman/5.6/en/old-client.html)
mysql> UPDATE mysql.user SET plugin = 'mysql_old_password'
mysql> WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR
    -> 'root'@'localhost' = OLD_PASSWORD('new_password');
And now I'm unable to even get access to mysql through mysql -u root because it gives me the error ERROR 1524 (HY000): Plugin 'mysql_old_password' is not loaded. I can't run mysqladmin and sudo mysqld_safe --skip-grant-tables gives me the error
51759
my-username@Macbook-Pro ~ % 
  + suspended (tty output)  sudo mysqld_safe --skip-grant-tables
When I tried to run mysqld --old-password=1 I got a whole lot of 2022-08-17T11:10:18.149573Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 35 I have tried uninstalling and reinstalling using homebrew for macOS, when that didn't work I also tried manually installing mysql from the website but that didn't work either. (I use mysql version 8.0.30 for macOS 12.4)
The Royal Guardian (31 rep)
Aug 17, 2022, 01:32 PM • Last activity: May 28, 2024, 09:44 AM
-1 votes
1 answers
521 views
How do I connect to a PostGres 14 server installed via Homebrew on Mac OS Big Sur?
I installed PostGreSQL 14 via Homebrew. I seem to be able to restart my local server ... $ brew services restart postgresql@14 Stopping `postgresql@14`... (might take a while) ==> Successfully stopped `postgresql@14` (label: homebrew.mxcl.postgresql@14) ==> Successfully started `postgresql@14` (labe...
I installed PostGreSQL 14 via Homebrew. I seem to be able to restart my local server ... $ brew services restart postgresql@14 Stopping postgresql@14... (might take a while) ==> Successfully stopped postgresql@14 (label: homebrew.mxcl.postgresql@14) ==> Successfully started postgresql@14 (label: homebrew.mxcl.postgresql@14) but whenever I try and connect, I repeatedly get this error $ psql -Upostgres psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket? What is the proper way to connect via psql to PostGres 14 on Mac OS Big Sur?
Dave (753 rep)
Nov 13, 2023, 03:09 AM • Last activity: Nov 14, 2023, 12:01 PM
0 votes
0 answers
433 views
MySQL and MariaDB on same macOS via brew
How do I install mariadb on my macOS Mojave via homebrew without destroying my MySQL 8 setup ? > Error: Cannot install mariadb because conflicting formulae are > installed. mysql: because mariadb, mysql, and percona install the > same binaries > > Please `brew unlink mysql` before continuing.
How do I install mariadb on my macOS Mojave via homebrew without destroying my MySQL 8 setup ? > Error: Cannot install mariadb because conflicting formulae are > installed. mysql: because mariadb, mysql, and percona install the > same binaries > > Please brew unlink mysql before continuing.
anjanesh (279 rep)
Dec 17, 2022, 02:32 AM
1 votes
1 answers
6956 views
Postgres CREATE DATABASE Not Working
I'm on a `Mac` using `Monterey`. It's a `Mac M1` which had a bit of an issue using `homebrew` to install `postgres` when I first started working on this machine. I moved to the `GUI` `postgres.app` which just seemed like a front for the underlying `postgres`, so I didn't think much had changed. In a...
I'm on a Mac using Monterey. It's a Mac M1 which had a bit of an issue using homebrew to install postgres when I first started working on this machine. I moved to the GUI postgres.app which just seemed like a front for the underlying postgres, so I didn't think much had changed. In any case the database (Postgres 12) is now running and I am seeing an issue with trying to create a new database. Same issue in a third party client as well as psql.
rich=# create database sresearch
rich-# \l
                                   List of databases
     Name     |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
--------------+----------+----------+-------------+-------------+-----------------------
 postgres     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 rich         | rich     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 sresearch    | rich     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
              |          |          |             |             | postgres=CTc/postgres
 weather      | rich     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
(5 rows)

rich-# \c sresearch
FATAL:  no such database: sresearch
The database cannot be made for some reason, even though it's reporting having done so. I have no clue why this is happening, but I want to fix it. I'm thinking I could make a backup and try to fix this by deleting both versions, then going back to homebrew to start again with Postgres 12. I'm not sure how to find out what the difference is between these two slightly different versions, which are essentially the same thing. How can I fix this? Obviously I need to be able to make new databases. Update: I just reinstalled the homebrew version and tried to import my alternative postgres.app export. It hung up on \connect for some reason but that was easy to manually get around. This installation **as well** gave me the same error on trying to create a new database. So both versions are showing the same, even from an export. I have no clue what to try.
rich=# \c sres
FATAL:  no such database: sres             # Indeed there is though
Previous connection kept
rich=#
Updated: More info ==>
rich=# \l
                                List of databases
     Name     | Owner | Encoding |   Collate   |    Ctype    | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
 postgres     | rich  | UTF8     | C           | C           |
 rich         | rich  | UTF8     | C           | C           |
 sres         | rich  | UTF8     | C           | C           |
 sresearch    | rich  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 template0    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
 template1    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
(6 rows)

rich=# \c sres;
FATAL:  no such database: sres
Previous connection kept
rich=# \s sresearch;
Wrote history to file "sresearch".
rich=#
Here is the feedback from Sequel: Commands from Ruby Here are the results from Ruby enter image description here Updated. Even more of the same. ==>
rich=# CREATE DATABASE alpha;
CREATE DATABASE
rich=# \c alpha;
FATAL:  no such database: alpha
Previous connection kept
rich=# \l
                                List of databases
     Name     | Owner | Encoding |   Collate   |    Ctype    | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
 alpha        | rich  | UTF8     | C           | C           |
 postgres     | rich  | UTF8     | C           | C           |
 rich         | rich  | UTF8     | C           | C           |
 template0    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
 template1    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
(5 rows)

rich=# DROP DATABASE alpha;
DROP DATABASE
rich=# \l
                                List of databases
     Name     | Owner | Encoding |   Collate   |    Ctype    | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
 postgres     | rich  | UTF8     | C           | C           |
 rich         | rich  | UTF8     | C           | C           |
 template0    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
 template1    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
(4 rows)

rich=# CREATE DATABASE alpha;
CREATE DATABASE
rich=# \l
                                List of databases
     Name     | Owner | Encoding |   Collate   |    Ctype    | Access privileges
--------------+-------+----------+-------------+-------------+-------------------
 alpha        | rich  | UTF8     | C           | C           |
 postgres     | rich  | UTF8     | C           | C           |
 rich         | rich  | UTF8     | C           | C           |
 template0    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
 template1    | rich  | UTF8     | C           | C           | =c/rich          +
              |       |          |             |             | rich=CTc/rich
(5 rows)

rich=# \c alpha;
FATAL:  no such database: alpha
Previous connection kept
rich=#
Rich_F (131 rep)
Feb 20, 2022, 03:11 PM • Last activity: Feb 22, 2022, 11:09 AM
1 votes
0 answers
225 views
Have I destroyed my postgresql database?
I installed psql using homebrew and I use it for some local data tracking. However, there were some issues with installing ruby using homebrew, so one suggestion was to reinstall it. Which I did, and now, I can't get my old databases back. Is it lost ? If so, what is a way I can avoid this in the fu...
I installed psql using homebrew and I use it for some local data tracking. However, there were some issues with installing ruby using homebrew, so one suggestion was to reinstall it. Which I did, and now, I can't get my old databases back. Is it lost ? If so, what is a way I can avoid this in the future ? This brew dependency seems a bit fragile.
hargun3045 (111 rep)
Oct 14, 2021, 03:36 PM • Last activity: Oct 14, 2021, 04:14 PM
3 votes
1 answers
17051 views
Server quit without updating PID file when trying to start MySQL server?
So I created my .bash_profile, opened it in a text editor and added: export PATH=$PATH:/usr/local/mysql/bin and then I saved it. Next, I tried running sudo /usr/local/mysql/support-files/mysql.server start was told to enter my password (so I did), and then terminal said Starting MySQL and then it ke...
So I created my .bash_profile, opened it in a text editor and added: export PATH=$PATH:/usr/local/mysql/bin and then I saved it. Next, I tried running sudo /usr/local/mysql/support-files/mysql.server start was told to enter my password (so I did), and then terminal said Starting MySQL and then it kept printing dots until it said: ERROR! The server quit without updating PID file (/usr/local/mysql/data/Nicks-MacBook-Pro.local.pid). The error logs look like: 2021-01-25T20:50:49.707062Z 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.23) starting as process 15092 2021-01-25T20:50:49.710232Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive 2021-01-25T20:50:49.834599Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2021-01-25T20:50:49.943719Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2021-01-25T20:50:50.037810Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock 2021-01-25T20:50:50.125494Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2021-01-25T20:50:50.126128Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2021-01-25T20:50:50.151069Z 0 [System] [MY-010931] [Server] /usr/local/mysql/bin/mysqld: ready for connections. Version: '8.0.23' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server - GPL. ~ ~ ~ ~ ~ (END) The output of ls -l /usr/local/mysql/data is: total 377992 -rw-rw---- 1 _mysql admin 196608 Jan 27 23:20 #ib_16384_0.dblwr -rw-rw---- 1 _mysql admin 8585216 Jan 25 15:50 #ib_16384_1.dblwr drwxrwx--- 12 _mysql admin 384 Jan 27 22:34 #innodb_temp -rw-rw---- 1 _mysql admin 112320 Jan 28 19:07 Nicks-MacBook-Pro.local.err -rw-rw---- 1 _mysql admin 56 Jan 25 15:50 auto.cnf -rw-rw---- 1 _mysql admin 667 Jan 25 15:50 binlog.000001 -rw-rw---- 1 _mysql admin 528 Jan 27 22:54 binlog.000002 -rw-r----- 1 _mysql admin 156 Jan 27 22:34 binlog.000003 -rw-r----- 1 _mysql admin 48 Jan 27 22:34 binlog.index -rw-rw---- 1 _mysql admin 1676 Jan 25 15:50 ca-key.pem -rw-rw---- 1 _mysql admin 1112 Jan 25 15:50 ca.pem -rw-rw---- 1 _mysql admin 1112 Jan 25 15:50 client-cert.pem -rw-rw---- 1 _mysql admin 1676 Jan 25 15:50 client-key.pem -rw-r----- 1 _mysql admin 3372 Jan 27 22:54 ib_buffer_pool -rw-rw---- 1 _mysql admin 50331648 Jan 27 23:20 ib_logfile0 -rw-rw---- 1 _mysql admin 50331648 Jan 25 15:50 ib_logfile1 -rw-rw---- 1 _mysql admin 12582912 Jan 27 22:35 ibdata1 -rw-r----- 1 _mysql admin 12582912 Jan 27 22:35 ibtmp1 drwxrwx--- 8 _mysql admin 256 Jan 25 15:50 mysql -rw-rw---- 1 _mysql admin 25165824 Jan 27 22:35 mysql.ibd -rw-rw---- 1 _mysql admin 2481 Jan 27 22:34 mysqld.local.err -rw-r----- 1 _mysql admin 4 Jan 27 22:34 mysqld.local.pid drwxrwx--- 111 _mysql admin 3552 Jan 25 15:50 performance_schema -rw-rw---- 1 _mysql admin 1680 Jan 25 15:50 private_key.pem -rw-rw---- 1 _mysql admin 452 Jan 25 15:50 public_key.pem -rw-rw---- 1 _mysql admin 1112 Jan 25 15:50 server-cert.pem -rw-rw---- 1 _mysql admin 1676 Jan 25 15:50 server-key.pem drwxrwx--- 3 _mysql admin 96 Jan 25 15:50 sys -rw-rw---- 1 _mysql admin 16777216 Jan 27 23:20 undo_001 -rw-rw---- 1 _mysql admin 16777216 Jan 25 15:50 undo_002 How do I fix this?
nickcoding (83 rep)
Jan 26, 2021, 09:01 PM • Last activity: Jan 29, 2021, 08:57 PM
3 votes
0 answers
731 views
How do I find out details about an error showed iby "brew services list"?
I want test my postgres13 service on mac by using "brew services list". I got following: $ brew services list Name Status User Plist postgresql error gerd /Users/gerd/Library/LaunchAgents/homebrew.mxcl.postgresql.plist How can I find out details about this error? In the /usr/local/var/log/postgres.l...
I want test my postgres13 service on mac by using "brew services list". I got following: $ brew services list Name Status User Plist postgresql error gerd /Users/gerd/Library/LaunchAgents/homebrew.mxcl.postgresql.plist How can I find out details about this error? In the /usr/local/var/log/postgres.log logfile (listed in homebrew.mxcl.postgresql.plist) is no error: 2021-01-28 17:36:59.429 CET LOG: starting PostgreSQL 13.1 on x86_64-apple-darwin19.6.0, compiled by Apple clang version 12.0.0 (clang-1200.0.32.27), 64-bit 2021-01-28 17:36:59.430 CET LOG: listening on IPv6 address "::1", port 5432 2021-01-28 17:36:59.431 CET LOG: listening on IPv4 address "127.0.0.1", port 5432 2021-01-28 17:36:59.431 CET LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2021-01-28 17:36:59.436 CET LOG: database system was shut down at 2021-01-28 17:35:44 CET 2021-01-28 17:36:59.440 CET LOG: database system is ready to accept connections My database work and I can connect with psql.
Gerd (143 rep)
Jan 28, 2021, 04:24 PM • Last activity: Jan 28, 2021, 04:42 PM
0 votes
1 answers
3192 views
postgres: could not find the database system
If I try to run the `postgres` command, I get: ``` 2020-12-29 00:14:53.213 GMT [34374] LOG: skipping missing configuration file "/usr/local/pgsql/data/postgresql.auto.conf" postgres: could not find the database system Expected to find it in the directory "/usr/local/pgsql/data", but could not open f...
If I try to run the postgres command, I get:
2020-12-29 00:14:53.213 GMT  LOG:  skipping missing configuration file "/usr/local/pgsql/data/postgresql.auto.conf"
postgres: could not find the database system
Expected to find it in the directory "/usr/local/pgsql/data",
but could not open file "/usr/local/pgsql/data/global/pg_control": No such file or directory
**How can I find out what config file is telling postgres to look at /usr/local/pgsql/data?** In my case, postgres was installed on OSX via Homebrew.
Troy (111 rep)
Dec 29, 2020, 12:34 AM • Last activity: Dec 29, 2020, 05:52 PM
Showing page 1 of 15 total questions