NOTE: I used mysql_native_password, so this is needed:
CREATE USER 'usersegmed'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON segmed.* TO 'usersegmed'@'localhost';
ALTER USER 'usersegmed'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypass';