更新时间:2023-01-31 09:36:56
首先,找到你的socket文件:
First, to find your socket file:
mysqladmin variables | grep socket
对我来说,这给:
| socket | /tmp/mysql.sock |
然后,在您的 config/database.yml
中添加一行:
Then, add a line to your config/database.yml
:
development:
adapter: mysql2
host: localhost
username: root
password: xxxx
database: xxxx
socket: /tmp/mysql.sock