In WordPress, creating user as administrator

In a WordPress instalation, using MySQL command I created a new user and then I gave it administrator capabilities. I did something like this:

INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_registered, user_status) VALUES ('matias', MD5('my_password'), 'Admin Matias', 'admin@myorg.com', NOW(), 0);

INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (LAST_INSERT_ID(), 'capabilities', 'a:1:{s:13:"administrator";b:1;}');

It worked but when I signed in, I did not have access to dashboard. Then I signed out and logged in with original Admin user, I accessed the dashboard, I oppened “users” and saw the newly created user but the role was missing.

I then gave it admin role and now in the DB (wp_usermeta) I have a duplicate value like so: 82 4 capabilities a:1:{s:13:“administrator”;b:1;} 84 5 capabilities a:1:{s:13:“administrator”;b:1;}

What did I do wrong in MySQL command?

Why didn’t it worked at first?