1

I have MySQL server installed on an AWS EC2 micro instance. The server was starting/stopping properly with sudo service mysql start/stop, but it stopped working since I made minor changes to the config file (changed port values and commented out bind address line).

Now when I do sudo service mysql start it says start: Job failed to start.

I've also tried doing sudo mysqld --port xx but it still wouldn't work.

I'm very new to this area so any help would be great.

EDIT: Here's the config

[client]
port            = xx
socket          = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = xx
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = (local ip address)

#
# * Fine Tuning
#
key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit       = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log

I won't post more of the config since it's just the default settings

ERROR (vim /var/log/mysql/error.log):

140811 20:20:29 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140811 20:20:29 [Note] Plugin 'FEDERATED' is disabled.
140811 20:20:29 InnoDB: The InnoDB memory heap is disabled
140811 20:20:29 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140811 20:20:29 InnoDB: Compressed tables use zlib 1.2.8
140811 20:20:29 InnoDB: Using Linux native AIO
140811 20:20:29 InnoDB: Initializing buffer pool, size = 128.0M
140811 20:20:29 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
140811 20:20:29  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
140811 20:20:30  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
140811 20:20:31  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
140811 20:20:32  InnoDB: Waiting for the background threads to start
140811 20:20:33 InnoDB: 5.5.38 started; log sequence number 0
140811 20:20:34  InnoDB: Starting shutdown...
140811 20:20:35  InnoDB: Shutdown completed; log sequence number 1595675
140811 20:20:36 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
140811 20:20:36 [Note] Plugin 'FEDERATED' is disabled.
140811 20:20:36 InnoDB: The InnoDB memory heap is disabled
140811 20:20:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140811 20:20:36 InnoDB: Compressed tables use zlib 1.2.8
140811 20:20:36 InnoDB: Using Linux native AIO
140811 20:20:36 InnoDB: Initializing buffer pool, size = 128.0M
140811 20:20:36 InnoDB: Completed initialization of buffer pool
140811 20:20:36 InnoDB: highest supported file format is Barracuda.
140811 20:20:36  InnoDB: Waiting for the background threads to start
140811 20:20:37 InnoDB: 5.5.38 started; log sequence number 1595675
140811 20:20:38  InnoDB: Starting shutdown...
140811 20:20:39  InnoDB: Shutdown completed; log sequence number 1595675

MORE ERROR: (dmesg | grep -i mysql)

... (pattern repeating)
[8847299.168709] init: mysql main process (1199) terminated with status 1
[8847299.168739] init: mysql main process ended, respawning
[8847299.246279] init: mysql post-start process (1200) terminated with status 1
[8847299.270609] type=1400 audit(1407875066.958:80): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=1246 comm="apparmor_parser"
[8847301.287139] init: mysql main process (1258) terminated with status 1
[8847301.287169] init: mysql respawning too fast, stopped

about bind address: i'm not sure what I should set bind address to. setting that to 0.0.0.0 worked for mongodb but from what I see here I shouldn't do that? this is only for performance testing so I don't need to worry about security.

More EDIT: When I change the port values on the config file it works again, but sadly I'm forced to use a specific port.

FINAL EDIT:

Well I spent about 7 hours trying to fix this issue but in the end I was unsuccessful. I asked my boss to open up port 3306 and used that instead.

  • Is this a troll post? If not, you should really ask yourself if you should mess with config files if you don't know what the parameters mean. First idea would be to revert the changes. Commenting the bind-address part out will completely kill MySQL as it has no machine to listen for. Usually this would be 127.0.0.1 or localhost (to give access only to itself), if you want to have another server to have access to the server you add his IP address. Without bind-address MySQL won't work. – Broco Aug 12 '14 at 19:22
  • Not a troll post. I was simply following a tutorial I found online. Coming from mongodb I thought what I read made sense. – jeebface Aug 12 '14 at 19:27
  • Can you provide your MySQL config and errors you see in MySQL error log when you try to start the service? – grekasius Aug 12 '14 at 19:44
  • @GiedriusRekasius he doesn't need to. He said he commented the bindin-address out which pretty much locks MySQL. He just has to uncomment it and set the port back to default. If he really wants to change the port he has to do it both for client and server or he will have to add the port every time he connects. About the bind-address as far as I know they changed it recently (just in case you wonder) because previously if you commented bind-address it had the same meaning as "bind-address = 0.0.0.0" which was a potential security risk. – Broco Aug 12 '14 at 20:04
  • Normally if bind-address is not specified in config, MySQL will listen to 0.0.0.0 unless skip-networking is specified. 0.0.0.0 in Linux means all IPs. – grekasius Aug 12 '14 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.