Equivalent to the command of the DBCC page of the SQL server in MySQL?

I could not find any MySQL site documentation on this

so DBCC page in the SQL server shows information about a page inside the database

My question is how to do this in MySQL?

(If it is not possible in MySQL, can you give an example of something other than MySQL? I just want to know if any other DBMS gives this option or not)

More information about this command: https://www.sqlskills.com/blogs/paul/finding-table-name-page-id/

System memory behavior during the import of huge mysql

I'm importing a huge dump (~ 900GB) in a mysql 5.5 server;

The system has 48GB of RAM.

Here are my InnoDB settings

innodb_read_io_threads = 16
innodb_write_io_threads = 16 # To highlight the double-write buffer
innodb_buffer_pool_size = 48000M
innodb_log_file_size = 1G #Small log files, more page flush
innodb_log_files_in_group = 2
innodb_file_per_table = 1
innodb_log_buffer_size = 1G
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 0
innodb_file_format = BARRACUDA
innodb_fast_shutdown = 1

Here are some Vmstat output in MB

procs ----------- memory ---------- --- swap-- ----- io ---- -system-- ------ cpu -----
r b swpd free buff cache if bi bo in cs us sy id id wa st
2 0 6324 290 6 206 3 0 7988 29188 1723 1576 7 1 82 10 0
1 0 6321 294 5 198 5 0 11436 29152 1935 1762 7 1 83 9 0
0 1 6318 285 5 202 5 0 9364 23940 1516 1350 8 1 82 9 0
0 1 6316 289 5 195 3 0 8136 30500 1636 1607 5 1 82 12 0
0 1 6316 288 5 196 0 0 384 5620 296 342 0 0 82 17 0
0 2 6315 287 5 197 0 0 992 984 173 232 1 0 69 30 0
0 2 6315 287 5 197 0 0 0 0 0 85 149 0 0 67 33 0
1 0 6314 289 5 192 1 0 3384 9788 699 597 2 0 80 18 0
0 1 6313 294 4 184 3 0 5360 10872 651 689 4 1 82 14 0
0 1 6310 289 4 185 4 0 10580 16796 1333 1276 7 1 82 10 0
0 1 6308 289 4 181 4 0 6272 23212 1233 1208 5 1 83 12 0
0 2 6307 290 4 178 2 0 4220 9956 696 740 3 0 72 25 0
0 2 6306 286 4 182 0 0 2712 3656 317 322 1 0 68 31 0
0 2 6305 283 4 182 1 0 4000 17172 1020 1094 3 1 81 15 0
1 0 6302 291 4 171 4 0 8712 25940 1479 1430 8 1 79 12 0

The imported database must be ~ 580G and now I'm at ~ 320G (the import has been running for a couple of days).

Why is the system changing so much?

Is there anything I can do (in the middle of importation) to accelerate it?

Why do I see processes in the secondcolumn (blocked) of Vmstat? Could the import itself be blocked by something?

I have globally disabled the foreign key checks.

mysql> shows variables like & # 39; fo% & # 39 ;;
+ -------------------- + ------- +
| Variable name | Value |
+ -------------------- + ------- +
| foreign_key_checks | OFF |
+ -------------------- + ------- +
1 row in set (2.63 sec)

clustering – mysql cluster with 1 master 1 node and 2 slave

Some of your previous responses have not been well received and you are in danger of being blocked.

Please pay close attention to the following guide:

  • Please make sure answer the question. Provide details and share your research!

But avoid

  • Ask for help, clarifications or respond to other answers.
  • Make statements based on opinion; Support them with references or personal experience.

For more information, see our tips on how to write excellent answers.

mysql – How to create a JSON file from PHP

I need to build a file JSON since PHP with a specific sequence, but I do not know how to build it.

The sequence is the following:

[{"jornada":"A","colegios":["Salle","Belemitas"]},
{"day": "B", "schools":["Nazaret","Comfama","jega"]}]

The database is as follows:

id | school | day |
-----------------------------
1 | Salle | A |
-----------------------------
2 | Nazareth | B |
-----------------------------
3 | Comfama | B |
-----------------------------
4 | Belemitas | A |
-----------------------------
5 | Jega | B |
-----------------------------
6 | Rosario | Unica |
-----------------------------

My attempt in PHP

                $ con = mysqli_connect ($ server, $ user, $ password, $ database);
    if (mysqli_connect_errno ()) {
        echo "APP:" mysqli_connect_error ();
    }

    $ query = mysqli_query ($ with, "SELECT * FROM ge_colegios ORDER BY day DESC;");


    $ json = '[';


    while ($row = mysqli_fetch_array($query)){
        $char ='"';
        $json .= 
        '{

            COMO CONSTRUYO LE SECUENCIA AQUI?

        },';
    }


    // buat menghilangkan koma diakhir array
    $json = substr($json,0,strlen($json)-1);

    $json .= ']';

    echo $ json;
    mysqli_close ($ with);

?>

Thank you

mysql – BIT_COUNT (hash1 ^ hash2) interprets the result of hash1 ^ hash2 as a string

So:

b & # 39; 1010 & # 39; ^ b & # 39; 0000 & # 39; = 0010

If I do it:
BIT_COUNT (b & # 39; 1010 & # 39; ^ b & # 39; 0000 & # 39;) I get the correct result (2)

But if I select the same values ​​from the table (binary fields)
BIT_COUNT (hash1 ^ hash2) I get the wrong result

Even if I do the hexadecimal fields and try to convert them into binaries and then count the bits, I will still get the same incorrect result:
BIT_COUNT (CONV (hex_hash1, 16, 2) ^ CONV (hex_hash2, 16, 2))

Another example of strange behavior, if I make the following query:

SELECT
BIT_COUNT (CONV (& # 39; b & # 39 ;, 16, 2) ^ CONV (& # 39; d & # 39 ;, 16, 2))

I got 9 as a result, when it should have been 2. As far as I can see, the result is processed as a string, I tried CAST (), CONV (), etc., and none of that works.

Does anyone know why?

(here is my environment)

& # 39; innodb_version & # 39 ;, & # 39; 5.7.23 & # 39;
& # 39; protocol_version & # 39 ;, & # 39; 10 & # 39;
& # 39; slave_type_conversions & # 39 ;, & # 39; & # 39; & # 39;
& # 39; tls_version & # 39 ;, & # 39; TLSv1, TLSv1.1, TLSv1.2 & # 39;
& # 39 ;, & # 39; 5.7.23-log & # 39;
& # 39; version_comment & # 39 ;, & # 39; Source distribution & # 39;
& # 39; version_compile_machine & # 39 ;, & # 39; x86_64 & # 39;
& # 39; version_compile_os & # 39 ;, & # 39; Linux & # 39;

How to make an employee maintenance system? Using laravel 5.3 / jQuery / bootstrap / MySQL

enter the description of the image here

Guidelines:
Use the Laravel 5.3 framework.
Use the MySQL database
Use bootstrap
Use jQuery
Set up an appointment about when to present and present this task.
Project name: Employee maintenance
Budget:
A user can log in with a username and password
A user can see the list of employees.
A user can search for specific employees
A user can add a new employee.
A user can edit an employee.
A user can delete an employee

mysql – missing InnoDB, ibdata1 corrupt

I was having a WordPress running from a raspberry pi. Accidentally I formatted it and configured a new operating system without exporting my InnoDB database, but I keep all the folders and files. Then I discover that my DB was corrupted.

after searching, I learned that the ibdata1 file is necessary for InnoDB. I have it but with the old ibdata1 the mysql deny to start. With innodb_force_recovery = 5 I start mysql successfully but my database tables give me an error table of 1932 that does not exist in the engine.

After a lot of research, I have no luck and I really do not know what to do next.

I move my db and ibdata1 to the Windows environment and resolve all the phpmyadmin errors, but I do not know what else is needed for ibdata1 to "see" my db.

I believe that the ibdata1 is not damaged, but simply disconnects from my database due to the change of the operating system environment. Maybe my ibdata1 wants to see the same db name, the same user account credentials and other raspbian settings? I do not know if I'm right. I do not know what ibdata1 requires from my old server. I have all the files. That's why I need your help.

Did you know MariaDB / MySQL? [sometimes] Can not you make a simple addition ?!

Ok, so I found this on my own the other day, working on one of our custom DBs.

This was verified / replicated on servers running … | Read the rest of http://www.webhostingtalk.com/showthread.php?t=1745054&goto=newpost

Using the Mariadb / mysql partition table column

I read the mariadb documentation: https: //mariadb.com/kb/en/library/partition-maintenance/

And it said:

The partition field should not be the first field in any key

But in the mysql documentation: https: //dev.mysql.com/doc/mysql-partitioning-excerpt/8.0/en/partitioning-limitations-partitioning-keys-unique-keys.html

And the examples use the first key field (unique key) for the partition.

CREATE TABLE t2 (
col1 INT NO NULL,
col2 DATE NOT NULL,
col3 INT NOT NULL,
col4 INT NO NULL,
UNIQUE KEY (col1, col3)
)
PARTITION FOR HASH (col1 + col3)
PARTITIONS 4;

So what is the problem if the partition field is the first field of a key?

mysql multiple ID sum values ​​grouped by ID within the range of dates

Where is the SQL query error? I want to add values ​​for multiple IDs within ranges of dates.
SELECT the date, ledger_name, sum (credit), sum (debit) of tbl_account WHERE ledger_name in (19,20,25,29) group by ledger_name and WHERE date BETWEEN & # 39; $ from_date & # 39; And & # 39; $ to_date & # 39;