質問編集履歴
1
更新
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
MySQLに変更したポートでアクセスできなかった???
|
body
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
現在laravelからMySQLに接続しようとしています。
|
1
2
|
```env
|
2
3
|
DB_CONNECTION=mysql
|
3
4
|
DB_HOST=localhost
|
@@ -7,11 +8,8 @@
|
|
7
8
|
DB_PASSWORD=root
|
8
9
|
```
|
9
10
|
|
10
|
-
上記のようにエンブファイルは設定されています。
|
11
|
-
|
11
|
+
ポート番号を3307にしていたせいで以下のエラーが出ておりました。
|
12
12
|
|
13
|
-
以下rootユーザーで「root」パスワードでログインできます。
|
14
|
-
|
15
13
|
```cmd
|
16
14
|
C:\xampp\htdocs\sample>mysql -u root -p
|
17
15
|
Enter password: ****
|
@@ -42,5 +40,133 @@
|
|
42
40
|
mysql>
|
43
41
|
```
|
44
42
|
|
43
|
+
しかし、ポートは3307に変更しています。
|
44
|
+

|
45
|
+
|
46
|
+
以下DBのiniファイルです。(一部抜粋)
|
47
|
+
```# Example MySQL config file for small systems.
|
48
|
+
#
|
49
|
+
# This is for a system with little memory (<= 64M) where MySQL is only used
|
50
|
+
# from time to time and it's important that the mysqld daemon
|
51
|
+
# doesn't use much resources.
|
52
|
+
#
|
53
|
+
# You can copy this file to
|
54
|
+
# C:/xampp/mysql/bin/my.cnf to set global options,
|
55
|
+
# mysql-data-dir/my.cnf to set server-specific options (in this
|
56
|
+
# installation this directory is C:/xampp/mysql/data) or
|
57
|
+
# ~/.my.cnf to set user-specific options.
|
58
|
+
#
|
59
|
+
# In this file, you can use all long options that a program supports.
|
60
|
+
# If you want to know which options a program supports, run the program
|
61
|
+
# with the "--help" option.
|
62
|
+
|
63
|
+
# The following options will be passed to all MySQL clients
|
64
|
+
[client]
|
65
|
+
# password = your_password
|
66
|
+
port=3306//ここ??
|
67
|
+
socket="C:/xampp/mysql/mysql.sock"
|
68
|
+
|
69
|
+
|
70
|
+
# Here follows entries for some specific programs
|
71
|
+
|
72
|
+
# The MySQL server
|
73
|
+
default-character-set=utf8mb4
|
74
|
+
[mysqld]
|
75
|
+
port=3307//ここ?
|
76
|
+
socket="C:/xampp/mysql/mysql.sock"
|
77
|
+
basedir="C:/xampp/mysql"
|
78
|
+
tmpdir="C:/xampp/tmp"
|
79
|
+
datadir="C:/xampp/mysql/data"
|
80
|
+
pid_file="mysql.pid"
|
81
|
+
# enable-named-pipe
|
82
|
+
key_buffer=16M
|
83
|
+
max_allowed_packet=1M
|
84
|
+
sort_buffer_size=512K
|
85
|
+
net_buffer_length=8K
|
86
|
+
read_buffer_size=256K
|
87
|
+
read_rnd_buffer_size=512K
|
88
|
+
myisam_sort_buffer_size=8M
|
89
|
+
log_error="mysql_error.log"
|
90
|
+
|
91
|
+
# Change here for bind listening
|
92
|
+
# bind-address="127.0.0.1"
|
93
|
+
# bind-address = ::1 # for ipv6
|
94
|
+
|
95
|
+
# Where do all the plugins live
|
96
|
+
plugin_dir="C:/xampp/mysql/lib/plugin/"
|
97
|
+
|
98
|
+
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
|
99
|
+
# if all processes that need to connect to mysqld run on the same host.
|
100
|
+
# All interaction with mysqld must be made via Unix sockets or named pipes.
|
101
|
+
# Note that using this option without enabling named pipes on Windows
|
102
|
+
# (via the "enable-named-pipe" option) will render mysqld useless!
|
103
|
+
#
|
104
|
+
# commented in by lampp security
|
105
|
+
#skip-networking
|
106
|
+
#skip-federated
|
107
|
+
|
108
|
+
# Replication Master Server (default)
|
109
|
+
# binary logging is required for replication
|
110
|
+
# log-bin deactivated by default since XAMPP 1.4.11
|
111
|
+
#log-bin=mysql-bin
|
112
|
+
|
113
|
+
# required unique id between 1 and 2^32 - 1
|
114
|
+
# defaults to 1 if master-host is not set
|
115
|
+
# but will not function as a master if omitted
|
116
|
+
server-id =1
|
117
|
+
|
118
|
+
# Replication Slave (comment out master section to use this)
|
119
|
+
#
|
120
|
+
# To configure this host as a replication slave, you can choose between
|
121
|
+
# two methods :
|
122
|
+
#
|
123
|
+
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
|
124
|
+
# the syntax is:
|
125
|
+
#
|
126
|
+
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
|
127
|
+
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
|
128
|
+
#
|
129
|
+
# where you replace <host>, <user>, <password> by quoted strings and
|
130
|
+
# <port> by the master's port number (3306 by default).
|
131
|
+
#
|
132
|
+
# OR
|
133
|
+
#
|
134
|
+
# 2) Set the variables below. However, in case you choose this method, then
|
135
|
+
# start replication for the first time (even unsuccessfully, for example
|
136
|
+
# if you mistyped the password in master-password and the slave fails to
|
137
|
+
# connect), the slave will create a master.info file, and any later
|
138
|
+
# change in this file to the variables' values below will be ignored and
|
139
|
+
# overridden by the content of the master.info file, unless you shutdown
|
140
|
+
# the slave server, delete master.info and restart the slaver server.
|
141
|
+
# For that reason, you may want to leave the lines below untouched
|
142
|
+
# (commented) and instead use CHANGE MASTER TO (see above)
|
143
|
+
#
|
144
|
+
# required unique id between 2 and 2^32 - 1
|
145
|
+
# (and different from the master)
|
146
|
+
# defaults to 2 if master-host is set
|
147
|
+
# but will not function as a slave if omitted
|
148
|
+
#server-id = 2
|
149
|
+
#
|
150
|
+
# The replication master for this slave - required
|
151
|
+
#master-host = <hostname>
|
152
|
+
#
|
153
|
+
# The username the slave will use for authentication when connecting
|
154
|
+
# to the master - required
|
155
|
+
#master-user = <username>
|
156
|
+
#
|
157
|
+
# The password the slave will authenticate with when connecting to
|
158
|
+
# the master - required
|
159
|
+
#master-password = <password>
|
160
|
+
#
|
161
|
+
# The port the master is listening on.
|
162
|
+
# optional - defaults to 3306
|
163
|
+
#master-port = <port>
|
164
|
+
#
|
165
|
+
# binary logging - not required for slaves, but recommended
|
166
|
+
#log-bin=mysql-bin
|
167
|
+
|
168
|
+
コード
|
169
|
+
```
|
170
|
+
|
45
|
-
|
171
|
+
見て分かる通り、いくつかport=3306になっており表面的には3307に代わっても実際には3306だったということですか??
|
46
|
-
|
172
|
+
以前ここ?としている「3307」の部分が「3306」であるのが原因でMySQLが立ち上がらなかったので「3307」に変更したという経緯があります。
|