我試圖連接到我的數據庫在Ubuntu遠程而是試圖mysql -u root -p
當我收到錯誤消息:MySQL的my.cnf文件 - 發現選項前沒有組
找到選項,而不在配置文件前組:/etc/mysql/my.cnf在行:1個
my.cnf中的樣子:
[mysqld]
user = mysql
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
bind-address = 0.0.0.0
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key_buffer = 16M
這與在Ubuntu上使用mysql安裝的默認my.cnf看起來很不一樣。您是否嘗試從默認文件開始並逐漸添加自定義項? –
我剛剛刪除了註釋並移動了代碼 – Afra
我認爲默認文件看起來有點不同。 – Emma