When MySQL is compiled in centos6.5, the following error occurs: exec: g ++: not found.

Source: Internet
Author: User
Tags localhost mysql

When MySQL is compiled in centos6.5, the following error occurs: exec: g ++: not found.

./Configure -- prefix =/usr/local/mysql -- with-extra-charsets = all -- with-innodb -- with-plugins = partition

Then make

The following error is reported:

../Depcomp: line 571: exec: g ++: not found

Make [1]: *** [my_new.o] Error 127

Make [1]: Leaving directory '/usr/local/src/mysql-5.1.34/mysys'

Make: *** [all-recursive] Error 1

The online answer is:

Yum install-y gcc-c ++

Okay, after this is installed, this error is not reported, and then execute make

./Include/my_global.h: 1110: error: redeclaration of C ++ built-in type 'bool'

After querying, the user said that c ++ was not installed, but I checked it. Yes.

[Root @ localhost Packages] # rpm-qa | grep gcc-c ++

Gcc-c ++-4.4.7-11. el6.i686

Let's look at other articles and say we can try again./configure. Okay, come back.

[Root @ localhost Packages] #! 145 press enter to go to you

I am a centos instance installed on a virtual machine and allocated MB of memory. How can I make it so long? I 've been around for a while, and it's not over yet ......

Make has no error. Please make install

No error is reported.

Next we will initialize it.

[Root @ localhost bin] #./mysql_install_db

Check whether/usr/local/mysql generates the var folder. If yes, the folder is generated successfully.

[Root @ localhost var] # ls

Localhost. localdomain. err mysql test

[Root @ localhost var] # pwd

/Usr/local/mysql/var

Then we can get up the MySQL service.

I actually executed servie mysqld restart, and the results can be imagined ......

[Root @ localhost bin] #./mysqld_safe -- user = mysql &

Then, you can verify whether it is running.

[Root @ localhost Packages] # ps-aux | grep 'mysql'

Warning: bad syntax, perhaps a bogu '-'? See/usr/share/doc/procps-3.2.8/FAQ

Root 31177 0.0 0.1 4356 744 pts/1 S + grep mysql

Okay, it's a good character. It's time to set a password.

[Root @ localhost bin] # // usr/local/mysql/bin/mysqladmin password 123456

/Usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed

Error: 'Can't connect to local MySQL server through socket '/tmp/mysql. sock' (2 )'

Check that mysqld is running and that the socket: '/tmp/mysql. sock' exists!

The service is getting up. Go to tmp and check it.

Look at the log. There is only one MySQL in the log.

Less/var/log/mysqld. log. rpmsave

150429 09:56:41 mysqld_safe mysqld from pid file/var/run/mysqld. pid ended

In/var/run, and then press table ......, Does not have this folder?

Create one.

[Root @ localhost tmp] # mkdir/var/run/mysqld & touch mysqld. pid & vim mysqld. pid

Add the service first.

Cd/usr/local/mysql/share/mysql

[Root @ localhost mysql] # cp mysql. server/etc/init. d/mysqld

Chkconfig -- add mysqld

Chkconfig -- list mysqld

Chkconfig -- lerels 35 mysqld on

Service mysqld restart

I rely on it to report an error

[Root @ localhost mysql] # service mysqld restart

ERROR! MySQL manager or server PID file cocould not be found!

Starting MySQL. ERROR! Manager of pid-file quit without updating file.


Two problems occurred before writing this record. At that time, I forgot to record the record ......

It seems that there is a redeclaration of C ++ built-in type 'bool'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.