P
P
Peter2015-10-31 13:09:37
MySQL
Peter, 2015-10-31 13:09:37

How to start local mysql if it doesn't let you connect after installation?

Hello.
Downloaded mysql, installed it, launched it through settings (mac).
A password was issued during installation. But with root/this password return an error when connecting via socket to localhost.
Already even created my.cnf, registered password=root there. It still doesn't help.
With what it can be connected?
my.cnf - default, only password added. Here:

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

password=root
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AVKor, 2015-10-31
@AVKor

registered there password=root

This should not be a password, but a login.
Like this:
user=root
password=BigSecret

R
Roman Mirilaczvili, 2015-10-31
@2ord

After (re)starting the server, you need to make sure that the server is ready to accept connections.
If specified in a configuration like this, socket=/var/mysql/mysql.sockthen check with mysqladmin -u root -p status.
If the connection is through a network port, then you need to check the ports listening like this: netstat -tuln4(Linux / Mac)
Try to check the connection withmysqladmin -h 127.0.0.1 -P 3306 -u root -p status

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question