Sample Header Ad - 728x90

Database Administrators

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

Latest Questions

0 votes
1 answers
1147 views
MongoDB in M1 Mac: 'mongod' command doesn't work
I'm totally new to mongodb and has no knowledge about it at all. So I just followed installation guides in the internet, but after installation 'mongod' command doesn't work and shows these lines... {"t":{"$date":"2021-11-09T21:19:35.029+09:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"thread1",...
I'm totally new to mongodb and has no knowledge about it at all. So I just followed installation guides in the internet, but after installation 'mongod' command doesn't work and shows these lines... {"t":{"$date":"2021-11-09T21:19:35.029+09:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"thread1","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":true}}} {"t":{"$date":"2021-11-09T21:19:35.030+09:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"thread1","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"} {"t":{"$date":"2021-11-09T21:19:35.032+09:00"},"s":"W", "c":"ASIO", "id":22601, "ctx":"thread1","msg":"No TransportLayer configured during NetworkInterface startup"} {"t":{"$date":"2021-11-09T21:19:35.032+09:00"},"s":"I", "c":"NETWORK", "id":4648602, "ctx":"thread1","msg":"Implicit TCP FastOpen in use."} {"t":{"$date":"2021-11-09T21:19:35.034+09:00"},"s":"W", "c":"ASIO", "id":22601, "ctx":"thread1","msg":"No TransportLayer configured during NetworkInterface startup"} {"t":{"$date":"2021-11-09T21:19:35.034+09:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","ns":"config.tenantMigrationDonors"}} {"t":{"$date":"2021-11-09T21:19:35.034+09:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"thread1","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","ns":"config.tenantMigrationRecipients"}} {"t":{"$date":"2021-11-09T21:19:35.034+09:00"},"s":"I", "c":"CONTROL", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":45353,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"SUHONGui-MacBookAir.local"}} {"t":{"$date":"2021-11-09T21:19:35.034+09:00"},"s":"I", "c":"CONTROL", "id":23351, "ctx":"initandlisten","msg":"{sysctlName} unavailable","attr":{"sysctlName":"machdep.cpu.extfeatures"}} {"t":{"$date":"2021-11-09T21:19:35.035+09:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"5.0.3","gitVersion":"657fea5a61a74d7a79df7aff8e4bcf0bc742b748","modules":[],"allocator":"system","environment":{"distarch":"x86_64","target_arch":"x86_64"}}}} {"t":{"$date":"2021-11-09T21:19:35.035+09:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Mac OS X","version":"21.1.0"}}} {"t":{"$date":"2021-11-09T21:19:35.035+09:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{}}} {"t":{"$date":"2021-11-09T21:19:35.038+09:00"},"s":"E", "c":"CONTROL", "id":20557, "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file."}} {"t":{"$date":"2021-11-09T21:19:35.038+09:00"},"s":"I", "c":"REPL", "id":4784900, "ctx":"initandlisten","msg":"Stepping down the ReplicationCoordinator for shutdown","attr":{"waitTimeMillis":15000}} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"COMMAND", "id":4784901, "ctx":"initandlisten","msg":"Shutting down the MirrorMaestro"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"SHARDING", "id":4784902, "ctx":"initandlisten","msg":"Shutting down the WaitForMajorityService"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"NETWORK", "id":20562, "ctx":"initandlisten","msg":"Shutdown: going to close listening sockets"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"NETWORK", "id":4784905, "ctx":"initandlisten","msg":"Shutting down the global connection pool"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"CONTROL", "id":4784906, "ctx":"initandlisten","msg":"Shutting down the FlowControlTicketholder"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"-", "id":20520, "ctx":"initandlisten","msg":"Stopping further Flow Control ticket acquisitions."} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"NETWORK", "id":4784918, "ctx":"initandlisten","msg":"Shutting down the ReplicaSetMonitor"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"SHARDING", "id":4784921, "ctx":"initandlisten","msg":"Shutting down the MigrationUtilExecutor"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"ASIO", "id":22582, "ctx":"MigrationUtil-TaskExecutor","msg":"Killing all outstanding egress activity."} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"COMMAND", "id":4784923, "ctx":"initandlisten","msg":"Shutting down the ServiceEntryPoint"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"CONTROL", "id":4784925, "ctx":"initandlisten","msg":"Shutting down free monitoring"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"CONTROL", "id":4784927, "ctx":"initandlisten","msg":"Shutting down the HealthLog"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"CONTROL", "id":4784928, "ctx":"initandlisten","msg":"Shutting down the TTL monitor"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"CONTROL", "id":4784929, "ctx":"initandlisten","msg":"Acquiring the global lock for shutdown"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"-", "id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"FTDC", "id":4784926, "ctx":"initandlisten","msg":"Shutting down full-time data capture"} {"t":{"$date":"2021-11-09T21:19:35.039+09:00"},"s":"I", "c":"CONTROL", "id":20565, "ctx":"initandlisten","msg":"Now exiting"} {"t":{"$date":"2021-11-09T21:19:35.040+09:00"},"s":"I", "c":"CONTROL", "id":23138, "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":100}} I've googled but couldn't find cases like above lines. I'm using m1 mac and installed mongodb by typing brew tap mongodb/brew brew install mongodb-community@5.0 Can anyone help?
SuHong Park (1 rep)
Nov 9, 2021, 12:39 PM • Last activity: Jun 29, 2025, 03:01 AM
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
181 views
Windows could not start the SQl server (SQLEXPRESS) service on Local Computer (MacOS running Windows 11 VM)
I have a common problem that I just cannot figure out after scrolling through posts expressing a similar issue. I am currently running a macOS using a virtual machine that has Windows 11. Due to what I understand are compatibility issues in the CPU architecture, I downloaded SQL Server 2019 Localdb....
I have a common problem that I just cannot figure out after scrolling through posts expressing a similar issue. I am currently running a macOS using a virtual machine that has Windows 11. Due to what I understand are compatibility issues in the CPU architecture, I downloaded SQL Server 2019 Localdb. When I try to connect to the server, I run into the exact issue this post described: https://stackoverflow.com/questions/41035516/sql-server-cant-start-to-connect My guess is that the issue is stemming from the fact that SQL Server (SQLEXPRESS) is stopped in SQL Server Configuration Manager, but when I try to right click and start, I get this message: enter image description here I suspect as well that the absence of startup parameters might be relevant: enter image description here I corrected this issue by going to the Registry Editor and added the strings manually: enter image description here They were added successfully in the Configuration Manager: enter image description here But, when I try to start the service, I get the same error message as above saying that my request failed (Event ID: 17058), but this time the issue is I get an Access Denied: initerrlog: Could not open error log file ‘c:\Program Files\Microsoft SQL Server\MSSQL15.SQLEXPRESS\MSSQL\Log\ERRORLOG’. Operating system error = 5(Access is denied). I am wondering whether my adding those parameters manually is a problem? It seems that the .mdf and .ldf are files that I don't have? Any help would be much appreciated.
Meditation (1 rep)
Dec 18, 2024, 04:25 PM • Last activity: Jan 3, 2025, 12:38 PM
0 votes
0 answers
16 views
Error creating PolarDB standby node on macOS
I am trying to set up a standby disaster recovery node for PolarDB on a macOS host using Docker. However, I am encountering an issue during the polar_basebackup process where it fails to create necessary directories. The error suggests that the directory /nvme2n1/shared_data/base&#160...
I am trying to set up a standby disaster recovery node for PolarDB on a macOS host using Docker. However, I am encountering an issue during the polar_basebackup process where it fails to create necessary directories. The error suggests that the directory /nvme2n1/shared_data/base could not be created, although /nvme2n1/shared_data/ seems to be created automatically. Below are the steps I've followed and the error details. How can I resolve this directory creation issue? Steps to Reproduce: 1. Create a Virtual Disk for Standby:
cd ~/data_volumn    
dd if=/dev/zero of=./VirtualDisk_standby.img bs=1m count=20480 oflag=direct
2. Start the Container pb3:
cd ~/data_volumn    
PWD=pwd    
    
docker run -d -it -v $PWD:/data -P --shm-size=1g --cap-add=SYS_PTRACE --cap-add SYS_ADMIN --privileged=true --name pb3 registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:ubuntu22.04 bash
3. Enter container pb3 and view the address:
docker exec -ti pb3 bash    
    
ip addr show    
  
116: eth0@if117:  mtu 65535 qdisc noqueue state UP group default   
    link/ether 02:42:ac:11:00:04 brd ff:ff:ff:ff:ff:ff link-netnsid 0  
    inet 172.17.0.4/16 brd 172.17.255.255 scope global eth0  
       valid_lft forever preferred_lft forever
4. Confirm that the network communication between pb3, pb1 and pb2 containers is normal:
# 安装ping 客户端  
  
sudo apt update    
sudo apt-get install -y inetutils-ping    
    
# 确认可以连通PolarDB 主节点和replica节点  
  
ping 172.17.0.2   
64 bytes from 172.17.0.2: icmp_seq=0 ttl=64 time=0.050 ms    
...  
ping 172.17.0.3   
64 bytes from 172.17.0.3: icmp_seq=0 ttl=64 time=0.050 ms
5. Create a loop device in pb3 to map to the virtual disk VirtualDisk_standby.img:
# 找一个可用的loop设备  
sudo losetup -f  
返回  
/dev/loop2  
  
# 使用新建的虚拟磁盘创建loop设备  
  
sudo losetup --direct-io=on /dev/loop2 /data/VirtualDisk_standby.img    
  
# 现在可以看到该loop设备  
$ losetup -a  
/dev/loop1: :36827 (/data/VirtualDisk.img)  
/dev/loop2: :109941 (/data/VirtualDisk_standby.img)  
/dev/loop0: :3407876 (/mount-services-cache/entries/services.iso/16203eaee29495c5a513341af851be45c30488427f5e3c87764e8b89a4a47d7a)
6. Softlink the loop device to nvme2n1 (note that nvme2n1 is different from nvme1n1 of primary & replica, it is not necessary, nvme2n1 is used here just to distinguish), easy to use
sudo ln -s /dev/loop2 /dev/nvme2n1
7. Format nvme2n1 using pfs:
sudo pfs -C disk mkfs -f nvme2n1
8. Start pfsd
sudo /usr/local/polarstore/pfsd/bin/start_pfsd.sh -p nvme2n1 -w 1
9. Copy the compiled polardb binary to the $HOME directory
$ cp -r /data/polardb/tmp_polardb_pg_15_base ~/    
  
    
$ which psql    
/home/postgres/tmp_polardb_pg_15_base/bin/psql
10. Back up PolarDB data to local storage and shared storage Perform the backup in the pb3 container used to deploy the Standby node, using ~/standby as the local data directory and /nvme2n1/shared_data as the shared storage directory:
polar_basebackup \
    --host=172.17.0.2 \
    --port=5432 \
    -D /home/postgres/standby \
    --polardata=/nvme2n1/shared_data/ \
    --polar_storage_cluster_name=disk \
    --polar_disk_name=nvme2n1 \
    --polar_host_id=3 \
    -X stream --progress --write-recovery-conf -v
The error is as follows: It looks likepolar_basebackup automatically created /nvme2n1/shared_data/, but did not automatically create /nvme2n1/shared_data/base
[PFSD_SDK INF Dec 17 17:42:37.947483]pfs_mount_prepare 103: begin prepare mount cluster(disk), PBD(nvme2n1), hostid(3),flags(0x13)  
[PFSD_SDK INF Dec 17 17:42:37.947583]pfs_mount_prepare 165: pfs_mount_prepare success for nvme2n1 hostid 3  
[PFSD_SDK INF Dec 17 17:42:37.983903]chnl_connection_poll_shm 1238: ack data update s_mount_epoch 1  
[PFSD_SDK INF Dec 17 17:42:37.983917]chnl_connection_poll_shm 1266: connect and got ack data from svr, err = 0, mntid 0  
[PFSD_SDK INF Dec 17 17:42:37.984060]pfsd_sdk_init 191: pfsd_chnl_connect success  
[PFSD_SDK INF Dec 17 17:42:37.984082]pfs_mount_post 208: pfs_mount_post err : 0  
[PFSD_SDK ERR Dec 17 17:42:37.989320]pfsd_opendir 1437: opendir /nvme2n1/shared_data/ error: No such file or directory  
[PFSD_SDK INF Dec 17 17:42:37.989439]pfsd_mkdir 1320: mkdir /nvme2n1/shared_data  
polar_basebackup: initiating base backup, waiting for checkpoint to complete  
polar_basebackup: checkpoint completed  
polar_basebackup: write-ahead log start point: 0/485F0700 on timeline 1  
polar_basebackup: starting background WAL receiver  
polar_basebackup: created temporary replication slot "pg_basebackup_64335"  
[PFSD_SDK INF Dec 17 17:42:38.149108]pfsd_mkdir 1320: mkdir /nvme2n1/shared_data/pg_wal  
[PFSD_SDK INF Dec 17 17:42:38.149659]pfsd_mkdir 1320: mkdir /nvme2n1/shared_data/pg_wal/archive_status  
[PFSD_SDK INF Dec 17 17:42:38.153165]pfsd_open 539: open /nvme2n1/shared_data/pg_wal/000000010000000000000001 with inode 3, fd 0  
polar_basebackup: error: could not create directory "/nvme2n1/shared_data/base": No such file or directory  
polar_basebackup: removing data directory "/home/postgres/standby"  
polar_basebackup: removing data directory "/nvme2n1/shared_data"  
[PFSD_SDK INF Dec 17 17:42:38.210123]pfsd_rmdir 1370: rmdir /nvme2n1/shared_data/pg_wal/archive_status  
[PFSD_SDK INF Dec 17 17:42:38.211285]pfsd_unlink 952: unlink /nvme2n1/shared_data/pg_wal/000000010000000000000001  
[PFSD_SDK INF Dec 17 17:42:38.212522]pfsd_rmdir 1370: rmdir /nvme2n1/shared_data/pg_wal  
[PFSD_SDK INF Dec 17 17:42:38.213276]pfsd_rmdir 1370: rmdir /nvme2n1/shared_data
Creation failed, the environment has been cleared
$ sudo pfs -C disk ls /nvme2n1/  
  File  1     4194304           Wed Dec 18 09:58:16 2024  .pfs-paxos  
  File  1     1073741824        Wed Dec 18 09:58:17 2024  .pfs-journal  
total 2105344 (unit: 512Bytes)
How can I ensure that the necessary directories are created automatically, or what steps should I take to resolve this issue?
nan bai (1 rep)
Dec 24, 2024, 02:17 AM
0 votes
0 answers
37 views
how do i use launchctl for mongod on macosx without homebrew to run the service as mongodb at startup
I'm wondering why I can run this command from terminal: sudo su mongodb -c "mongod --config /etc/mongod.conf" but the LaunchAgent cannot run this command on login as root, so that my mongodb can start always as a service. I think it is related to LaunchAgent not knowing the root password, because wh...
I'm wondering why I can run this command from terminal: sudo su mongodb -c "mongod --config /etc/mongod.conf" but the LaunchAgent cannot run this command on login as root, so that my mongodb can start always as a service. I think it is related to LaunchAgent not knowing the root password, because when I run the command from terminal - naturally I need to input the password for my user. I can run the mongod binary in the way mongo recommends. Meaning, I am running it as a user I created named "mongodb". The user I am logged in as does not have read/write access to any of the "mongodb" data directories, etc, which is also the recommended security configuration. But my user is a sudoer, and can "su" (switch users) to the mongodb user and run a command with sudo. However, launchctl is unable to run the service when my user logs in. I created and successfully bootstrapped and started my service plist under /Library/LaunchAgents/com.my.test.plist Below are snips from example plist configs I've tried and their resultant errors: ProgramArguments su mongodb -c "mongod --config /etc/mongod.conf" Service log error is: *su: Sorry* ProgramArguments sudo su mongodb -c "mongod --config /etc/mongod.conf" Service log error is: *sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper* I do not want to use the -S option, because that would be awful to store a root password somewhere on my system. Also the command needs to be run using "sudo" because per mongoDBs pre-requisites, the use of the mongodb data directory, the /etc/mongod.conf file, the log directory, and the mongod binary itself are all only supposed to be owned by and usable by the "mongodb" user (which is why they create the "mongodb" user in the first place instead of just advocating that you use your regular login user?) UserName mongodb ProgramArguments mongod --config /etc/mongod.conf There are no errors written to the service file with this configuration, but the service is not running. When I check why with launchctl print gui/$(id -u)/com.my.test.plist I find that *last exit code = 78: EX_CONFIG* sysexits I'm wondering why I can run this command from terminal: sudo su mongodb -c "mongod --config /etc/mongod.conf" but the LaunchAgent cannot run this command on login as root, so that my mongodb can start always as a service. **please refrain from any homebrew responses.** The point of this installation is to not use homebrew (it's not needed) and to learn how to use launchctl directly as mongo intends. Also I thought to try and put my service in **/System/**Library/LaunchAgents/com.my.test.plist (because maybe the LaunchAgent would not be prompted to enter the root password then?) but this is also not possible, since this directory and kind of service is reserved for software services created by Apple. I’ve also tried the /Library. /LaunchDaemon to some extent with variations of the plist configs above with similar results. I also tried using crontab -e And having @reboot my.sh scripts running without success
user1709076 (101 rep)
Oct 21, 2024, 04:57 PM
0 votes
0 answers
52 views
SQL Developer app crashes
I have downloaded SQL developer on my Mac running OS Sonoma 14.1.2 but as soon as i launch it it quits unexpectedly. I have installed latest JDK 11. I don't seem to find the reason for its crash. I executed sqldeveloper.sh in terminal and i encountered following error line 16: [: missing `]'/Library...
I have downloaded SQL developer on my Mac running OS Sonoma 14.1.2 but as soon as i launch it it quits unexpectedly. I have installed latest JDK 11. I don't seem to find the reason for its crash. I executed sqldeveloper.sh in terminal and i encountered following error line 16: [: missing `]'/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
Wasim Wani (101 rep)
Oct 20, 2024, 06:33 AM • Last activity: Oct 20, 2024, 08:41 AM
1 votes
1 answers
80 views
Collation difference in PostgreSQL on AWS RDS and local machine
I have an issue with collation in PostgreSQL when sorting a result set. We use AWS RDS PostgreSQL, and we want to sort query results in a specific way. Locally, everything works perfectly on my laptop (macOS), and all tests are passing. However, after deploying to the staging environment on AWS RDS,...
I have an issue with collation in PostgreSQL when sorting a result set. We use AWS RDS PostgreSQL, and we want to sort query results in a specific way. Locally, everything works perfectly on my laptop (macOS), and all tests are passing. However, after deploying to the staging environment on AWS RDS, the sort order is different. After some research, I realized that the "en_US.UTF-8" collation on my laptop behaves differently than it does on the AWS RDS instance. ### Environment details: - Locally: macOS, PostgreSQL 14.7 - Staging (AWS RDS): PostgreSQL 14.12 I don't think the version difference should matter much in this case. ### Here is the query and result locally on my macOS machine
SELECT UNNEST(ARRAY['A', '#', 'b', '@', '🕸️spider', '!symbol', 'Try', '💨wind', 'Zzzzzz']) COLLATE "en_US.UTF-8" AS title 
ORDER BY title;
#### Result (local machine)
["!symbol", "#", "@", "A", "Try", "Zzzzzz", "b", "💨wind", "🕸️spider"]
- Symbols (!, #, @) appear first. - Letters (A, Try, Zzzzzz, b) come next. - Emojis (💨wind, 🕸️spider) appear last. ### However, on staging (AWS RDS)
SELECT UNNEST(ARRAY['A', '#', 'b', '@', '🕸️spider', '!symbol', 'Try', '💨wind', 'Zzzzzz']) COLLATE "en_US.utf8" AS title 
ORDER BY title;
#### Result (staging environment)
["@", "#", "A", "b", "🕸️spider", "!symbol", "Try", "💨wind", "Zzzzzz"]
The order is inconsistent with the local result: - Symbols and letters are mixed. - Emojis don't follow the same pattern. ### What I've tried/checked 1. I confirmed that both environments are using the "en_US.UTF-8" collation. However, on AWS RDS, the collation name appears as "en_US.utf8" (lowercase .utf8). 2. The PostgreSQL versions are slightly different: 14.7 locally and 14.12 on staging, but I don't think this should affect collation behavior. ### Questions - Why are the collation results different between my local macOS environment and AWS RDS? - How can I make the sort order consistent across both environments?
Taras (119 rep)
Oct 3, 2024, 10:47 AM • Last activity: Oct 3, 2024, 04:56 PM
0 votes
0 answers
123 views
Cannot login into MariaDB after restarting the machine
I'm using MacOS Sonoma 14.5 and trying to login in mariadb via terminal. However, when I execute ```sh mariadb -uroot -password ``` It is returning ```error ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2) ``` I searched online and the solution to this would be...
I'm using MacOS Sonoma 14.5 and trying to login in mariadb via terminal. However, when I execute
mariadb -uroot -password
It is returning
ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2)
I searched online and the solution to this would be to generate a mysql.sock file by executing
brew services start mariadb
# OR brew services restart mariadb
However, I tried it, as you can see below:
$ brew services restart mariadb
Stopping mariadb... (might take a while)
==> Successfully stopped mariadb (label: homebrew.mxcl.mariadb)
==> Successfully started mariadb (label: homebrew.mxcl.mariadb)
Still, not any mysql.sock file is generated inside the /tmp folder and I can't login in the mariadb database.
victorcosta@Victors-MacBook-Pro:/tmp $ cd /tmp
victorcosta@Victors-MacBook-Pro:/tmp $ ls
com.apple.launchd.6mj6GfdTiF powerlog
So, how can I connect to mariadb?
Victor Cordeiro Costa (119 rep)
Jul 23, 2024, 01:20 PM
0 votes
1 answers
208 views
Cannot reset password for the root user in MySQL
I’m trying to install and setup MySQL on my Machine (MacBook Pro M3 Max with Sonoma 14.5 OS) but it is not being possible to login anymore. The root password keep being changed after I shut down the machine and turn it on on the next day. When I run the the `mysql_secure_installation` command and tr...
I’m trying to install and setup MySQL on my Machine (MacBook Pro M3 Max with Sonoma 14.5 OS) but it is not being possible to login anymore. The root password keep being changed after I shut down the machine and turn it on on the next day. When I run the the mysql_secure_installation command and try to setup a password, the following access denied error happens:
$ mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root: 
Error: Access denied for user 'root'@'localhost' (using password: YES)
I’ve tried to change the password for the root user by executing
sudo mysqld_safe --skip-grant-tables
, then
mysql -root
, then the commands to reset the password, but it says that a mysqld process already exists, which blocks the execution of further commands.
$ sudo mysqld_safe --skip-grant-tables

2024-07-04T17:57:49.6NZ mysqld_safe Logging to '/opt/homebrew/var/mysql/Victors-MacBook-Pro.local.err'.
2024-07-04T17:57:49.6NZ mysqld_safe A mysqld process already exists
↳ This error is happening even after I kill all the mysqld and mysql processes with
sudo kill -9
or
sudo pkill -9 mysqld
or
sudo killall -9 mysqld
or
sudo killall -9 mysqld_safe
or listing all the processes with
ps aux | grep mysql
and killing each one of them manually via
sudo kill -9
So, in the end, I can’t use MySQL at all on my machine due to this login issue. Could someone help me? Thank you!
Victor Cordeiro Costa (119 rep)
Jul 4, 2024, 08:30 PM • Last activity: Jul 22, 2024, 07:23 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
0 votes
0 answers
183 views
MAMP PRO 6.9, PHP 8.2.0, Mac 14.21 and Mongo DB - Apache Fails
Have been trying to get MongoDB installed on MAMP PRO 6.9, PHP 8.2.0, Mac 14.21 via PECL but after a successful install and enabling the extension, when restarting MAMP Pro, Apache fails and none of my sites are available. Disabling the extension doesn't help and I have to delete it and reinstall MA...
Have been trying to get MongoDB installed on MAMP PRO 6.9, PHP 8.2.0, Mac 14.21 via PECL but after a successful install and enabling the extension, when restarting MAMP Pro, Apache fails and none of my sites are available. Disabling the extension doesn't help and I have to delete it and reinstall MAMP Pro to get back to normal. Any help appreciated. Regards, Nigel I tried re-installing the extension, Google-searched extensively.
Nigel McLaughlin (59 rep)
Mar 6, 2024, 12:23 AM • Last activity: Mar 14, 2024, 03:58 AM
2 votes
2 answers
8286 views
Disable auto-start of postgres server on boot (Mac)
Running a Mac. I installed Postgresql 9 many years ago and configured it to auto-start. Now I have upgraded to version 12 using brew, but on system restart version 9 server is still starting automatically. I don't know how to determine what is starting it, I don't see anything in my bash_profile and...
Running a Mac. I installed Postgresql 9 many years ago and configured it to auto-start. Now I have upgraded to version 12 using brew, but on system restart version 9 server is still starting automatically. I don't know how to determine what is starting it, I don't see anything in my bash_profile and I don't see a feature in brew or pg_ctl that allows me to disable an auto-start configuration. I have no postgres files in /Library/LaunchAgents either. Thanks
David (165 rep)
Oct 2, 2020, 12:31 AM • Last activity: Oct 27, 2023, 12:22 AM
1 votes
2 answers
814 views
Migrating MySQL databases to a new server with phpMyAdmin
Looking for the best way to migrate a dozen or so MySQL databases from an old Mac mini to a new one. I've tried the source machine's phpMyAdmin (v. 4) EXPORT command, using what looked like reasonable options, and with all my existing databases selected. It created a 5+GB SQL file. Scanning through...
Looking for the best way to migrate a dozen or so MySQL databases from an old Mac mini to a new one. I've tried the source machine's phpMyAdmin (v. 4) EXPORT command, using what looked like reasonable options, and with all my existing databases selected. It created a 5+GB SQL file. Scanning through it, I see the "CREATE TABLE" commands but not any "CREATE DATABASE" commands. Am I doing it wrong?
Rob Lewis (111 rep)
Jun 5, 2023, 05:50 PM • Last activity: Jun 10, 2023, 12:38 AM
3 votes
0 answers
536 views
Unable to Install PostGIS Extension for PostgreSQL 15 on Mac Book with M1 Chip and macOS Ventura 13.3.1
Issue: Unable to install PostGIS extension for PostgreSQL 15 on Mac Book with M1 chip and macOS Ventura 13.3.1. *Steps I have taken:* + Installed PostgreSQL 15 using the terminal. + Installed PostGIS using the command brew install postgis. + Tried executing the command psql -U boikoandrii -d postgre...
Issue: Unable to install PostGIS extension for PostgreSQL 15 on Mac Book with M1 chip and macOS Ventura 13.3.1. *Steps I have taken:* + Installed PostgreSQL 15 using the terminal. + Installed PostGIS using the command brew install postgis. + Tried executing the command psql -U boikoandrii -d postgres -c "CREATE EXTENSION postgis VERSION '3.2.0' SCHEMA public;", but received the error "could not open extension control file". + Attempted to find the path to the postgis.control file using the pg_config --sharedir and find commands, but without success. + Tried installing the PostGIS extension for PostgreSQL 14 and 13, but encountered the same "could not open extension control file" error. Additionally: 1. Installed Rosetta 2. 2. Installed pgAdmin version 7.1. 3. Installed PostgreSQL 14, 13, and 15, but version 15 is not displayed in pgAdmin4. Also, I want to fix an issue with displaying PostgreSQL version 15 in Pgadmin. The psql CREATE EXTENSION command also does not work (syntax has been verified). Please provide assistance on how to install the PostGIS extension for PostgreSQL 15 on my Mac Book with M1 chip. Thank you!
Ravers UA (31 rep)
May 26, 2023, 06:28 AM
0 votes
0 answers
1408 views
Error mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)
I'm completely new to MySQL and phpmyadmin. I was trying to add a password to my database/phpmyadmin but then I got this error: >mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) > >phpMyAdmin tried to connect to the MySQL server, and the server rej...
I'm completely new to MySQL and phpmyadmin. I was trying to add a password to my database/phpmyadmin but then I got this error: >mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) > >phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server. I'm using XAMPP on a MacBook Air. I've gone through couple of YouTube videos but they're on windows, and the XAMPP looks very different from mine. I will continue looking for help but I am not winning currently.
Rori Putu (1 rep)
Apr 28, 2023, 07:33 AM • Last activity: Apr 28, 2023, 09:04 AM
0 votes
0 answers
653 views
Error 13117 while setting up master-slave replication with both DB servers being on the same Mac M1 machine
I am trying to create a master-slave replication with both the Mysql Servers being on the same machine. The first mysql server, which I intend to keep as the master was installed using the Mysql Native Package Installer mentioned [here][1] Following is the `my.cnf` configuration file used for the ab...
I am trying to create a master-slave replication with both the Mysql Servers being on the same machine. The first mysql server, which I intend to keep as the master was installed using the Mysql Native Package Installer mentioned here Following is the my.cnf configuration file used for the above master server. Location of the file: /etc/my.cnf
[mysqld]
server-id=1 #was confused which one is the correct server-id key, thus added both of them.
server_id=1
log-bin=mysql-bin-master
default_authentication_plugin=mysql_native_password
Once the above was done, I started the master Mysql Server using the Mysql Preference Pane in MacOS (the last tab in System Preferences on Mac) Following is the my.ini configuration for the Slave. Location of the file: /etc/my.ini
[mysqld]
server-id=2
server_id=2
log-bin=mysql-bin-slave
relay-log=relay-log-bin
log-slave-updates=1
read-only=1
replicate-ignore-db=mysql
replicate-do-db=mydatabase
replicate-ignore-table=mydatabase.logs
replicate-wild-ignore-table=mydatabase.temp_%
master-info-repository=TABLE
relay-log-info-repository=TABLE
replicate-same-server-id=1
Thereafter, I tried to setup the slave mysql server instance using the following command:
sudo mysqld --user=mysql --datadir=/usr/local/mysql/replica/data --port=3307 --log-error=/usr/local/mysql/replica/data/error.log --pid-file=/usr/local/mysql/replica/data/mysql.pid --defaults-file=/etc/my.ini
I had created a replica folder inside /usr/local/mysql/ where all of the data files for replica could be kept. I created a user account on the Master with the following command: CREATE USER 'replica'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; and granted replication access via GRANT REPLICATION SLAVE ON *.* TO 'replica'@'%'; Thereafter, tried logging in to the SLAVE Mysql console and start replication via:
CHANGE MASTER TO MASTER_HOST='localhost', MASTER_USER='replica', MASTER_PASSWORD='password', MASTER_LOG_FILE='mysql-bin-master.000001', MASTER_LOG_POS=157;
START SLAVE;
But when I do, SHOW SLAVE STATUS, I get the following error:
mysql> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: localhost
                  Master_User: replica
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin-master.000001
          Read_Master_Log_Pos: 157
               Relay_Log_File: Karans-Air-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 123456
              Relay_Log_Space: 697
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 13117
                Last_IO_Error: Fatal error: The replica I/O thread stops because source and replica have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on replica but this does not always make sense; please check the manual before using it).
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID:
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Replica has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp: 230423 18:02:08
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
       Master_public_key_path:
        Get_master_public_key: 0
            Network_Namespace:
1 row in set, 1 warning (0.00 sec)
Also, checked the MASTER_LOG_POS already and MASTER_LOG_FILE. Both of them are correct!
karan kapoor (1 rep)
Apr 23, 2023, 01:20 PM
7 votes
2 answers
5777 views
Is there a way to use standard CLR functions on Azure SQL Edge for Ubuntu Docker on an M1 Mac?
I have a MacBook with an M1 chip, so (about) the only option for me to run SQL Server is to [run it as a Docker container](https://database.guide/how-to-install-sql-server-on-an-m1-mac-arm64/). This works fine for standard SQL, but our application uses some CLR features like [`COMPRESS`](https://lea...
I have a MacBook with an M1 chip, so (about) the only option for me to run SQL Server is to [run it as a Docker container](https://database.guide/how-to-install-sql-server-on-an-m1-mac-arm64/) . This works fine for standard SQL, but our application uses some CLR features like [COMPRESS](https://learn.microsoft.com/en-us/sql/t-sql/functions/compress-transact-sql) ; when I try to use that, it tells me > Msg 50000, Level 16, State 1, Line 45 Common Language Runtime(CLR) is not enabled on this instance. [Enabling it](https://learn.microsoft.com/en-us/sql/relational-databases/clr-integration/clr-integration-enabling) does not work:
EXEC sp_configure 'clr enabled', 1;  
RECONFIGURE;  
GO
gives > Msg 15392, Level 16, State 1, Procedure sp_configure, Line 166 The specified option 'clr enabled' is not supported by this edition of SQL Server and cannot be changed using sp_configure. I found [this Stack Overflow post](https://stackoverflow.com/q/59690813/4751173) but that is about someone using a custom .NET library; I'm looking for the 'standard' functionality available in SQL Server for Windows.
Glorfindel (2205 rep)
Feb 8, 2022, 10:45 AM • Last activity: Mar 13, 2023, 10:42 AM
-2 votes
2 answers
2299 views
How can I install SQLServer in MAC M1?
I want to run SQL on my MAC M1, I used guidelines according to this website: https://phoenixnap.com/kb/install-sql-server-macos and I used this instruction: docker pull mcr.microsoft.com/mssql/server:2019-latest then: docker run -d --name example_sql_server -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Strong....
I want to run SQL on my MAC M1, I used guidelines according to this website: https://phoenixnap.com/kb/install-sql-server-macos and I used this instruction: docker pull mcr.microsoft.com/mssql/server:2019-latest then: docker run -d --name example_sql_server -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Strong.Pwd-123' -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest Now my Docker is showing a Container, but it is not active always. When I click on the run button it becomes active for about 5 seconds and then turn off. Finally, I couldn't have SQL in Azure or another platform because my Container isn't active. Please help me.....
mari rajabpour
Nov 13, 2021, 02:10 PM • Last activity: Jan 22, 2023, 01:51 PM
Showing page 1 of 20 total questions