36

I just did a fresh install of Apache server 2.2. Everything works. When I go to localhost I get: "It Works!"

I just installed mySQL5.5 and when I go to localhost:3306 I just get gibberish:

J��� 5.5.22�'���4[LM{D~p�ÿ÷!�€����������6[I=4/+,9z{|�mysql_native_password�!��ÿ„#08S01Got packets out of order

I see many posts on the internet with users with similar problems, but I can't figure out a solution.

Can anyone help?

Julio
  • 5,208
  • 1
  • 13
  • 42
Adam
  • 731
  • 2
  • 10
  • 16

5 Answers5

35

The mysql service is not a web interface - you cannot connect using a browser. You will need to install a mysql client of some kind.

rainecc
  • 1,432
  • 16
  • 15
  • I ran an sql script that created a db. I created a php page that spits out the data in the db, but I get the garbled text above when I try to load the page: localhost:3306/test.php – Adam Apr 07 '12 at 11:24
  • You need to be loading the page using http://localhost/test.php. That is the apache server. It is the apache server that is delivering test.php, not the database. 3306 is the port that the database listens on for database connections, such as from your code. – rainecc Apr 07 '12 at 11:31
  • In my case, I was connecting to the wrong port while running a docker-compose based project, – steinkel Nov 30 '21 at 15:59
4

If you try to start phpmyadmin then do it like this:

localhost/phpmyadmin
Black
  • 18,150
  • 39
  • 158
  • 271
1

I'm a jsp beginner. I have a same problem with you. I guess it's kind of port problem.

For me, I had set the port for Apache server connector as 9090. Later, when I installed mysql, the port for mysql was 3306 as its default port.

In my jsp file, i loaded jdbc driver like 'jdbc:mysql://localhost:9090/dbname' and then i call 'http://localhost:9090/my.jsp' on my web browser. That's when I got the same problem with you.

I fixed the port part in my jsp file like 'jdbc:mysql://localhost:3306/dbname' and I could get it all right.

I think you need to check the port for your Apache server. You can check out \conf\server.xml file in your Apache directory. The part starts with "Connector port=8080...." in server.xml file. If so, you need to put 'http://localhost:8080... on your browser.

Silver
  • 19
  • 2
0

Try just to write http://localhost/ without the port and it will work , Or go to your phpmyadmin and click on My websites and it will take you immediately to your localhost

-1

I'm having exactly the same problem, so far I have : 1)Manually changed the Collation (it seemed to be defaulting to cp850)

2)altered the ini/cnf file (located under services.msc -> MySQL)

3)Changed the max_packet_size to 2G

3)rebooted the server.

As a start to this please run this script from MySQL 'SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';'

It should bring up a table of your collations, they should all read utf8 Possible causes