我在AWS EC2微型实例上安装了MySQL服务器。 服务器启动/停止sudo服务mysql启动/停止正常 ,但它停止工作,因为我对configuration文件(更改的端口值和注释掉绑定地址线)进行了微小的更改。
现在,当我做sudo服务mysql启动它说启动:作业启动失败 。
我也尝试做sudo mysqld –port xx,但它仍然无法正常工作。
我对这个领域很陌生,所以任何帮助都会很棒。
编辑:这是configuration
[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
我不会发布更多的configuration,因为它只是默认设置
错误(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
更多错误:(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
关于绑定地址:我不知道我应该设置绑定地址。 设置为0.0.0.0为mongodb工作,但从我看到这里我不应该这样做? 这只是性能testing,所以我不需要担心安全性。
更多编辑:当我改变configuration文件的端口值它再次工作,但不幸的是我被迫使用特定的端口。
最终编辑:
那么我花了大约7个小时试图解决这个问题,但最终我没有成功。 我问我的老板打开端口3306,并用它来代替。