It is necessary to save: 1) hash (32) characters (letters and numbers). 2) ip address 3) date

What is the best way to customize these posts?

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants of D-side , cheops , VenZell , Cerbo , ReinRaus Jun 5 '16 at 23:30 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • I mean how to set up? - nick_n_a
  • Well, what type of fields to specify? where what to put down correctly so that later there would be no errors with requests and answers to mysql - SloGS
  • What IP-address do you plan to store? Numeric or string? Only support IPv4 or IPv6. If it is not difficult to supplement the issue with clarifications. - cheops
  • @E_p read, I read about all the data types in mysql about the tables, but I did not find anything I decided to ask - SloGS

1 answer 1

Use the following data types:

  • hash VARCHAR(32)
  • VARCHAR(15) ip address (IPv4 for example 192.168.100.100)
  • date DATE() (only for a date without time, format is 0000-00-00)
  • date and time DATETIME() (format format 00:00:00)
  • And why ip is not BIGINT? And how are you going to store IPv6? Why answer such questions when the author did not even think for a second about even the right question? - E_p
  • If the author did not think - this does not mean that you do not need to answer the question. I understand that the author had in mind. I did not write anything about IPv6. - mr.Mouse