Centos 7.4 安装mysql 5.7.19 社区版

因centos7 版本自带mariadb,可提前卸载。


yum -y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make libnuma1 numactl libaio ——主要要有gcc及gcc-c++


groupadd mysql useradd -r -g mysql -s /bin/false mysql



tar -xvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz -C /usr/local/mysql


mkdir -p /home/mysql/data

chown -R mysql mysql /home/mysql/data

chgrp -R mysql mysql /home/mysql/data



bin/mysqld --initialize --basedir=/usr/local/mysql --datadir=/home/mysql/data --user=mysql



# cp -a ./support-files/my-default.cnf/etc/my.cnf



port=35060 ————-变默认3306端口 datadir=/home/mysql/data




explicit_defaults_for_timestamp=true ———–加此可解决timestamp报错

binlog-ignore-db =mysql binlog-ignore-db =information_schema binlog_format =ROW sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES interactive_timeout=31536000 ————加此解决8小时无数据断开连接 wait_timeout=31536000

log-bin=/home/mysql/data/mysql-bin ———–开日志可做增量备份

log-bin-index =/home/mysql/data/mysql-bin.index binlog_cache_size=32m max_binlog_cache_size=512m max_binlog_size=512m server-id=101 socket = /home/mysql/mysql.sock log-error=/var/log/mysql/mysql.log pid-file=/tmp/mysql.pid



touch /var/log/mysql/mysql.log

chown -R mysql:mysql /var/log/mysql/mysql.log


cp /support-files/mysql.server /etc/rc.d/init.d/mysql

chkconfig --level 35 mysql on


systemctl start  mysqld.service

或/etc/init.d/mysql start


./mysql -u root -p
Enter password:          ————为初始化时产生,若忘记在此处找:/root/.mysql_secret

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

mysql> flush privileges; mysql> quit;

firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload

# echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile

分类:DB 标签:


  1. Howdy I am so thrilled I found your blog, I really found you by
    error, while I was looking on Bing for something else, Regardless I am here now and would just like to say many thanks for a fantastic post and a all round interesting blog (I
    also love the theme/design), I don’t have time to read it
    all at the moment but I have book-marked it and also added your RSS feeds, so when I have time
    I will be back to read more, Please do keep up the awesome b.

  2. Hi would you mind stating which blog platform you’re working with?
    I’m looking to start my own blog soon but I’m having a tough time
    selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs
    and I’m looking for something completely unique.
    P.S My apologies for being off-topic but I had to ask!

  3. I was very pleased to find this web site. I need to to thank you
    for your time due to this fantastic read!! I definitely
    enjoyed every bit of it and I have you book-marked to look at new stuff in your blog.

  4. I’m gone to inform my little brother, that he should also pay a visit this web site on regular basis to take updated from most up-to-date news update.

    Also visit my site – special

  5. Hey I know this is off topic but I was wondering if you knew
    of any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite
    some time and was hoping maybe you would have some experience with something
    like this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

  6. Hi there just wanted to give you a quick heads up.
    The words in your post seem to be running off the screen in Opera.
    I’m not sure if this is a formatting issue or something to do with browser
    compatibility but I figured I’d post to let you know.
    The style and design look great though! Hope you get the
    issue solved soon. Cheers

  7. I was recommended this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my problem.
    You’re incredible! Thanks!

  8. I’ll immediately clutch your rss as I can’t to find your e-mail subscription link
    or e-newsletter service. Do you’ve any? Please permit me understand
    in order that I could subscribe. Thanks.

  9. Great blog here! Also your website so much up fast! What web host are you
    the usage of? Can I am getting your associate link on your host?
    I wish my site loaded up as quickly as yours lol

  10. Awesome! Its truly amazing piece of writing, I have got much clear idea concerning from this article. Marigold

  11. you’re really a just right webmaster. The site
    loading pace is incredible. It sort of feels that you’re doing any distinctive trick.
    Also, The contents are masterpiece. you’ve done
    a magnificent job in this topic!

  12. Attractive component of content. I simply stumbled upon your website and in accession capital to say that I get in fact loved account your blog posts.otto von muller

  13. Woah! I’m really loving the template/theme of this blog.

    It’s simple, yet effective. A lot of times it’s hard to get that “perfect balance” between superb usability and visual appeal.
    I must say you have done a great job with this.
    Additionally, the blog loads super quick for me on Firefox.
    Outstanding Blog!

  14. I like the valuable information you supply to your articles.
    I will bookmark your blog and test once more right here
    frequently. I am quite sure I will be informed many new stuff right here!
    Good luck for the following!

  15. I’m eager to uncover this page. I need to thank you for ones time only for this phenomenal read!! I certainly appreciated all aspects of it and I have you saved to fav to look at new data on your site.

  16. This is really interesting, You’re a very professional blogger.
    I have joined your feed and stay up for in search of more of your fantastic post.
    Also, I’ve shared your web site in my social networks

  17. Wow, awesome blog format! How lengthy have you been running a blog for?
    you make blogging look easy. The full look of your website
    is fantastic, let alone the content material!

  18. I’m impressed, I have to admit. Rarely do I encounter a blog that’s equally educative and interesting, and let me
    tell you, you have hit the nail on the head. The problem is something not enough folks are speaking intelligently
    about. Now i’m very happy I stumbled across this in my
    hunt for something regarding this.

  19. I’ve been exploring for a bit for any high quality articles or weblog posts
    in this sort of area . Exploring in Yahoo I finally stumbled upon this website.
    Studying this info So i’m happy to express that I have a very good uncanny feeling
    I found out exactly what I needed. I most without a doubt will make sure to don?t overlook this web site
    and give it a glance on a constant basis.

  20. I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to
    do it for you? Plz reply as I’m looking to design my own blog and would like to know where
    u got this from. many thanks

  21. I’m really enjoying the theme/design of your blog. Do
    you ever run into any web browser compatibility problems?

    A handful of my blog audience have complained about my blog not operating correctly in Explorer
    but looks great in Chrome. Do you have any ideas to help fix this problem?

    My web site; best CBD oil for dogs

  22. Way cool! Some extremely valid points! I appreciate you penning this write-up and also the rest of the site is really good. Auroora Yance Noma

  23. Keep up the good piece of work, I read few posts on this internet site and I think that your site is rattling interesting and contains circles of excellent info . Robbi Sherwood Dorr

  24. I delight in, lead to I discovered just what I was having a look for. You have ended my 4 day long hunt! God Bless you man. Have a nice day. Bye Eleanore Kendall Nenney

  25. A motivating discussion is definitely worth comment. I do believe that you need to write more about this issue, it might not be a taboo matter but generally people do not speak about these subjects. To the next! Kind regards!! Sheelagh Halsy Guendolen

  26. I am truly glad to read this website posts which carries tons of helpful information, thanks for providing these kinds of information. Raven Alonso Lauri

  27. Hello. This article was extremely motivating, particularly because I was looking for thoughts on this topic last Saturday. Charlena Alejoa Gerard

  28. Thank you, I have just been searching for information about this subject for a while and yours is the best I have came upon till now. However, what in regards to the conclusion? Are you sure about the source? Roselia Had Joete

  29. Having read this I believed it was really informative. I appreciate you finding the time and effort to put this article together. I once again find myself personally spending a lot of time both reading and posting comments. But so what, it was still worth it! Arlee Gardy Genvieve

  30. I am truly glad to glance at this webpage posts which consists of lots of useful data, thanks for providing these kinds of data.| Catie Durward Ruberta

  31. I precisely desired to thank you very much once again. I am not sure the things I could possibly have carried out in the absence of the strategies revealed by you concerning such a situation. Completely was a very troublesome circumstance in my circumstances, nevertheless finding out a new professional mode you handled the issue took me to cry for happiness. I will be grateful for this information and thus have high hopes you are aware of a powerful job you are always carrying out educating most people via your web site. Most likely you have never come across any of us. Shanon Mayne Donelle

  32. After research a few of the weblog posts on your web site now, and I really like your means of blogging. I bookmarked it to my bookmark website record and might be checking back soon. Pls check out my site as effectively and let me know what you think. Germaine Malchy Diskson

  33. The root of your writing whilst appearing agreeable at first, did not really sit perfectly with me personally after some time. Somewhere within the paragraphs you were able to make me a believer but just for a short while. I however have a problem with your jumps in assumptions and you would do well to help fill in those gaps. When you actually can accomplish that, I could definitely be fascinated. Anstice Payton Spaulding

  34. Having read this I thought it was rather
    enlightening. I appreciate you spending some time and energy to put this informative article
    together. I once again find myself personally spending
    a lot of time both reading and commenting. But so what, it was still worthwhile!

    Review my website Buy CBD

    1. I thіnk this іs one of thе mⲟst vital
      info f᧐r mе. And i’m glad reading yoսr article. Βut wanna remark on sⲟme general things, Tһe
      site style iѕ ideal, tһe articles is reɑlly nice : D.
      Goodd job, cheers

      Мy web site – click here

    2. You’re so intereѕting! I do nnot think Ι’ve trulʏ read thrоugh
      anytһing ⅼike thks bef᧐re. Տo good to fіnd ɑnother person ԝith sоme original thouɡhts оn this subject.
      Seriousⅼy.. thаnk уou fоr starting tһis up.
      This webb site іs somethіng tһat’s needded on tһe web, ѕomeone
      with а little originality!

      mү web blog :: visit this page

    3. I’m гeally loving thе theme/design ߋf yoսr weblog. Do yoս
      еver run іnto any internet browser compatibility
      issues? А feѡ оf my bkog readers һave complained аbout my sitee not wоrking correctly іn Explorer ƅut ⅼooks great
      iin Chrome. Do yoᥙ have any suggestions tօ help fіx this problem?

      Visit my webpage ::more info

    4. Greetings! Ꭲhiѕ іs my 1st cߋmment ere soo
      Ijst wanted to give a quick shout оut aand tell
      you I genuinely enjoy readkng yoyr blog posts.

      Caan yоu suɡgest any other blogs/websites/forumsthat deal ԝith the same subjects?
      Aⲣpreciate it!

      My webpage :: visit this page

    5. Vеry nice post. I just stumbled upon your blog
      and wished tօ say that I’ve truly enjoyed browsing your blog posts.
      In аny case I’ll be suubscribing to youг feeed and I
      hope you wгite agaіn very soon!

      ᒪоok into my web blog :: more info

    6. I dߋn’t еѵеn know hߋw I finished uр гight һere,
      Ьut І thought this ρut up used to Ƅe great.
      I do not realize who y᧐u’re hοwever definitely you’re ɡoing to a weⅼl-known blogger іf yоu aren’t already.


      Look аt my web page; this page